app开发者平台在数字化时代的重要性与发展趋势解析
593
2022-10-04
[git]怎样git clone所有远程branch
转自: clone a remote Git repository and cd into it:
$ git clone git://example.com/myproject$ cd myproject
Next, look at the local branches in your repository:
$ git branch* master
But there are other branches hiding in your repository! See these using the -a flag:
$ git branch -a* master remotes/origin/HEAD remotes/origin/master remotes/origin/v1.0-stable remotes/origin/experimental
To take a quick peek at an upstream branch, check it out directly:
$ git checkout origin/experimental
To work on that branch, create a local tracking branch, which is done automatically by:
$ git checkout experimentalBranch experimental set up to track remote branch experimental from origin.Switched to a new branch 'experimental'
Here, "new branch" simply means that the branch is taken from the index and created locally for you. As the previous line tells you, the branch is being set up to track the remote branch, which usually means the origin/branch_name branch.
Your local branches should now show:
$ git branch* experimental master
You can track more than one remote repository using git remote:
$ git remote add win32 git://example.com/users/joe/myproject-win32-port$ git branch -a* master remotes/origin/HEAD remotes/origin/master remotes/origin/v1.0-stable remotes/origin/experimental remotes/win32/master remotes/win32/new-widgets
At this point, things are getting pretty crazy, so run gitk to see what's going on:
$ gitk --all &
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~