git status says up-to-date with remote even though it's not
We have a git repository hosted on a shared network drive that multiple co-workers access. I’ll call this the “Central Repository”. Employees clone this repo to their local machines, make changes, then push changes back up.
We’ve noticed that if someone pushes a change to the Central Repository, other employee’s local git repos don’t indicate that they are out of sync.
git status says
- Git model for website development with Bitbucket
- Git: how to create different unmerged states?
- how to make git ignore ignores in .gitignore
- Git: Ignoring directories only if they have no tracked files
- Why doesn't “git status” display unpushed commits in a branch?
- why 'git status' in cloned repository check current branch against origin remote and not in repository that I create
On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean
But it’s clearly not up-to-date. There are changes on the remote but git isn’t sensing them. You can do a
git pull and it immediately downloads the changes to your local repo even though it claimed it was already up-to-date.
Why is this happening? Is it because the central repository is hosted on a shared network drive? And maybe git is for whatever reason not able to tell if it’s out of sync? Using a GUI like Git Tower doesn’t make a difference either. Even hitting “Refresh” in the GUI does not make any indication that it’s out of sync. Also, the local master branch is tracking
Is there anything that can be done to fix this problem?
One Solution collect form web for “git status says up-to-date with remote even though it's not”
You have to call
git fetch to get updates from remote repo to your local repo but without changing your current branch position. After that
git status will show proper results.