How git clone actually works

后端 未结 5 1315
暗喜
暗喜 2021-01-31 06:04

I have a repository on Github with 2 branches: master and develop.

When I clone the repository and run $ git branch it shows only

5条回答
  •  梦毁少年i
    2021-01-31 06:28

    When you clone a repository you will get all branches and all commits that can be reached from any of those branches.

    You will however not get a local branch of any other branch than master. The other ones are there as remote branches (remotes/origin/development) and you can check out any of those whenever you want. git will then set up tracking between the remote branch and the local one that you created when you did the check out.

提交回复
热议问题