I am using Git to cooperate with other users, but today I cannot get the latest change on some files using "git pull
", and I cannot see the changes in "git log
".
What could be the issue?
This might be happening because of some conflict files present in your repository . And you was still trying to check in files . So After that what happen , it will check in your local repository not in master repository . So u was not able to pull or check in anythings in master(head) repository .
git pull Not Updating Files Due to Uncommitted Files in Your Local Repository. As a source code management system, Git does its best to prevent you from losing your files and data. For this reason, Git may refuse to merge your local files with files from your remote repository when performing the git pull command.
The git pull command is used to fetch and download content from a remote repository and immediately update the local repository to match that content.
what worked for me is ,
.git
folder.git
from other repogit checkout
Before Removing , You can try
git fetch --all
git reset --hard origin/master
You will need to replace master
with the appropriate branch, which now defaults to main
.
What worked for me,
git reset --hard origin/master
It showed me that some file names were too long for git to pull them from my repo and hence the mismatch and incorrect builds.
So I ran following to fix and did a hard reset again.
git config --system core.longpaths true
Thankfully it worked.
In my case the issue was me having an index.lock
file in my .git
folder. I removed that, and pull worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With