0

I am facing something I do not understand. I push and pull to a GitHub repository from two different machines.

When I commit a change locally from one of the machines and then push on the remote, on my other machine the repository does not see the change:

git status returns

Your branch is up to date with origin master

Despite this, when I do git pull the change is applied to my local repository.

Moreover, making a commit directly on GitHub is not seen in either of the machines.

Thee command git remote -v returns the same thing on both systems.

I don't understand! Why can't I see that my local repository is behind the remote?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Meaulnes
  • 357
  • 6
  • 20
  • You should try `git fetch` instead: `git pull` will rebase/merge your branch. That's probably why you don't see anything in the status: your development on Windows and Linux does not differ that much for a merge conflict to occurs. – NoDataFound Aug 16 '23 at 11:57

1 Answers1

3

You just need clarification about what git status actually means. git status doesn't go check the remote branch for changes. All it does is check what it already knows about the remote. You can use the command, git remote update to fetch those changes and then Git's "knowledge" of the remote branch will be updated. Running git status after that will do what you expected it to do in the first place.

Caleb
  • 205
  • 1
  • 8