After working on a feature branch and also successfully setting my PR, I usually switch back to master. git checkout master gives me when checking out: Switched to branch "master". Your branch is at the same level as ‘origin/master’.
Then when I do a git pull, git pulls down all the new changes on master and merges them into my local master.
Step 1: git checkout master
Step 2: git pull
But why does well tell me at step 1. that it is up to date with the origin? But in step 2 it fetches and merges the new changes. According to my understanding, it would be yes then not up to date!?
>Solution :
When you git checkout master git will not automatically make a network request to check the remote server state. It merely checks the caches and the history tree available locally to you.
However, if you happen to git pull --all while in the feature branch and there were changes pushed to the remote, only then git will report that your local master branch is behind origin/master when you git checkout master .