I'm on a local branch, and switched back to main
. It said Your branch is up to date with origin/main
, but when I do git pull
it does pull a bunch of new updates. Does this not mean that my branch was not up to date with origin/main
?
CodePudding user response:
Your local Git does not know about the state of the remote server unless you fetch first. Once you have fetched you can inspect the status of your branch and it will tell you, that you are behind or that the branches have diverged.
Almost all commands in Git operate locally and only a few of them need internet access, such as push, fetch, ls-remote