Default behaviour of 'git pull'

后端 未结 3 2021
天涯浪人
天涯浪人 2021-01-05 01:34

Why is that git pull pulls everything including newly created remote branches but git pull origin master does not?

I\'m using git ver

3条回答
  •  情话喂你
    2021-01-05 02:24

    Its is really simple

    When you say git pull everything irrespective of any hooks and filter gets added to your local. In short you get everything from your remote and update the .git folder. You can go to folder .git/logs/refs/remotes/origin/ you will see the branches all that you have on your local.

    So, Now I typed git pull from my cmd.

    What happen behind the curtain is irrespective of the local branches you have. It hooks up the origin and get every from there to your local.

    But, when I type git pull origin master. In this you give a path specification from origin you need a latest head of master branch. Then only master brach gets pulled and refreshed as it is on remote

    So, origin master is a path spec they called in git language for path.

提交回复
热议问题