1Īfter the fetch is complete, pull runs merge, or if you so specify, rebase, on some set of branch-head commits. This specifically limits your git fetch operation to fetch only commits new-to-you that are on their master, so as to update only your origin/master. Here origin is a remote and master is a refspec (see the git fetch documentation for more about remotes and refspecs). You can, however, run: git fetch origin master You cannot run git pull origin/master # also wrong: this runs git fetch origin/master Just as you would not run: git fetch origin/master # wrong Read the git pull documentation carefully for exceptions (of which there are plenty), but in general, most of the arguments you pass to git pull, git pull passes to git fetch. That is because this is the special syntax just for git pull. I tried git pull origin/master and it didn't work git pull origin master worked The oldest versions of Git that people still seem to use today are in the version 1.7 range-but when you run git pull, you're harking back to the pre-stone-age, dinosaur Git 1.5 era.) (Note that Git is now at version 2.26, so this is truly ancient history, dating back to 2005 or so. This is due to history: git pull predates a number of improvements made in Git between pre-1.5 and post-1.6 Git versions. However, the syntax one uses with git pull does not match the syntax one uses with pretty much every other Git command. I thought git pull was like a git fetch + git merge.
0 Comments
Leave a Reply. |