My first tip is not git pull . Do a git fetch and then git merge .
To answer the null question: in fact, you are updated. You have all the commits that the remote repository has. Thus, there is nothing left to extract or combine 1 .
To answer your first question:
git commit : commit your changes to your branch, completely unrelated to what is happening in the remote repositories.git fetch origin : get the contents of the remote repository ( origin ), but keep them under the origin/branch . At the moment, your own code is not changed.git merge origin/master : merge origin/master , which is the master branch of the remote origin repository (which you have selected right now) with your current branch.git push origin : push commit and merge to remote repository
To answer the second question:
git fetch origin : update origin/branch .git diff origin/master : get the difference between the current branch and the origin/master branch.
1 Suppose that this is what initially appears in your repository, on the master branch:
A -> B -> C -> D -> E | |\- master | \- origin/master
This is right after you cloned the repository. Now you say that you made a new commit on your local master branch:
A -> B -> C -> D -> E -> F | | | \- master | \- origin/master
So there are two things.
Assuming that someone else will not be deleted in the remote origin , there is nothing new to retrieve. So git fetch origin master tells you that there is nothing new.
If you do git merge origin/master , there is nothing to merge again. origin/master is the prefix of master . In other words, master already contains all the commits that origin/master has, so there is nothing new to merge.
If you used fetch and merge instead of pull , you could easily figure out which part of the double pull command is the one that leads to unexpected (in your opinion) behavior.
Of course, after git push origin master you will get:
A -> B -> C -> D -> E -> F | |\- master | \- origin/master
Shahbaz
source share