Git pull - default remote and branch using -u option - works with push but not pull

前端 未结 3 1343
猫巷女王i
猫巷女王i 2021-02-10 10:21

I am on Git version 2.6.3, and get this message when just running

git pull

\"There is no tracking information for the current br

3条回答
  •  离开以前
    2021-02-10 11:08

    -uis just a shortcut for using --set-upstream. This flag will cause your local branch to track your remote branch from remote upstream. You only need to do this action once and ideally at the begining by using git push -u origin .

    This means that when you use git pull, git fetch and git push it should assume that your local branch and the remote branching that is tracking will sync.

    If you want to know read more go here: An Asymmetry Between Git Pull and Git Push

提交回复
热议问题