Difference between different refspecs in a git-pull call

后端 未结 3 1103
后悔当初
后悔当初 2021-01-17 03:34

Whats the difference between using the following git commands

git pull origin master
git pull origin master:master

Some ob

3条回答
  •  既然无缘
    2021-01-17 04:17

    A git pull inherently performs two operations: First, a git fetch, followed by git merge.

    With git pull origin master, the master branch of your origin remote will be fetched (retrieved), then merged into your current, checked-out branch.

    By defining two branch names, you are specifying a refspec of which branch is merged into which.

    The generalized example reads as follows: "Retrieve the source branch from the specified remote, merge it with the destination branch.

    git pull :

提交回复
热议问题