git 如何从 SourceTree 中的远程主节点创建分支?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24239227/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to create a branch from a remote master in SourceTree?
提问by Despotars
I have a git master in my SourceTree, and I want to create a branch on another computer. How I can do this? (Master = Remote, in the same network)
我的 SourceTree 中有一个 git master,我想在另一台计算机上创建一个分支。我怎么能做到这一点?(主 = 远程,在同一网络中)
回答by griffon vulture
Create the branch locally
在本地创建分支
git checkout -b branch_name
And then push to remote
然后推送到远程
git push -u remote-name branch-name
Then in the remote
然后在远程
git pull branch-name
And it will automatically be created locally.
它会在本地自动创建。
回答by Gorodeckij Dimitrij
On another machine connect SourceTree to master (clone)
在另一台机器上将 SourceTree 连接到 master(克隆)
Then with shell navigate to project folder and run such:
然后使用 shell 导航到项目文件夹并运行:
git branch -r
(will show all remote branches)
git branch -r
(将显示所有远程分支)
git checkout --track origin/[branch name]
git checkout --track origin/[branch name]
repeat checkout for all branches - SourceTree will get them almost immediately
对所有分支重复结帐 - SourceTree 几乎会立即获取它们