Q: Git wrongly believes I am up to date I've been working on a project between both my laptop and my desktop and using a GitHub repository to sync between them. Last night I pushed my changes from my laptop to GitHub, but this morning when I went to pull them to my desktop git shows that I'm already up to date. Specifically, typing
git status shows I have nothing locally to commit and prints:
"On branch main
Your branch is up to date with sync/main"
But looking at the GitHub repository online shows that I definitely have committed multiple things from my laptop since the last commit from my desktop. When I check out the branch's HEAD I can see that it has the commit id of the last commit I made from the desktop, including that commit's message.
Any advice on how to fix it?

A: Git doesn't automatically ask the remote repositories if there's something new.
When you run git status, it compares your local branch with the local copy of the remote branch, it doesn't look at the actual remote branch on the remote repository.
You have to run git fetch to make your local copy of remote branches up to date.
Note that this happens automatically when you run git pull which is basically a git fetch followed by a git merge/rebase.
