What can cause `git pull` to not see remote changes?

In what circumstances can the git pull origin master command lead to a different working copy state than git checkout mastergit pullgit checkout feat-agit merge master ?

Long story.

I have a function branch, let's call it feat-a . I am the only developer working in this industry. The branch was created from the master branch. Both branches are of remote origin, origin/feat-a and origin/master . Nothing special, your typical git repository location.

Today I wanted to update my feature branch from a remote master . From earlier conversations with other developers, I knew that there would be conflicting changes when I merge the remote master into my function branch.

I am using SourceTree. So, with checking the feat-a branch, I opened the context menu in the origin / master branch and selected Pull origin/master into current branch . I was shocked that git reported that my branch was already updated. I knew this was wrong, there should be changes on the remote master branch. I repeated the command several times. Always got the same current message.

To be 100% sure, I made it a long way. I checked the master branch, clicked the Pull button. The branch has been updated with the latest commits. Then I checked the feat-a branch, and then pulled out the context menu on the main branch and selected Merge master into current branch . Voila! Here was a merge conflict that I was expecting to get!

It puzzled me. I assumed that doing Pull from origin/master to my current branch is the same as checking master , pulling, checking another branch, and then merging master into the current branch (except pulling from the remote master to another branch does not update the local master , but this should not affect this problem).

Essentially, for some reason, the Pull command from origin/master in feat-a tried to convince me that there were no changes to origin/master , and that only the long path with switching branches and manual merging worked properly.

I'm not sure if SourceTree is doing anything special that could affect this problem.

+5
source share
1 answer

You say you use Sourcetree, so I think you did not actually enter git pull origin master at the command line. I assume this is either something confusing in the GUI message or an error in Sourcetree.

I'd rather ask Sourcetree developers.

+1
source

Source: https://habr.com/ru/post/1243752/


All Articles