git 如何将“develop”分支推送到远程“origin”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14733712/
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 push the "develop" branch to the remote "origin"?
提问by AdamT
When I do git flow init
it creates a master
and develop
branches. When I add the remote I do git remote add origin [email protected]:NewB/our-repo.git
. Now I have git flow initialized on my local repo and I have the remote repo added. After I do git push -u origin master
I have master
in my origin but not the develop
branch. Is there a git flow publish
for the develop
branch? All I'm seeing are publish
for feature
or release
branches. Does git-flow want me to just use regular git and do git push origin develop
?
当我这样做时,git flow init
它会创建一个master
和develop
分支。当我添加遥控器时,我会这样做git remote add origin [email protected]:NewB/our-repo.git
。现在我在本地存储库上初始化了 git flow,并且添加了远程存储库。我做后git push -u origin master
我有master
我的起源而不是develop
分公司。有没有git flow publish
为develop
分支?我所看到的都是publish
为了feature
或release
分支。git-flow 是否希望我只使用常规的 git 并做git push origin develop
?
采纳答案by Daniel Hilgarth
Does git-flow want me to just use regular git and do
git push origin develop
?
git-flow 是否希望我只使用常规的 git 并做
git push origin develop
?
Yes, that's what you do. Simply use the regular git command.
是的,这就是你要做的。只需使用常规的 git 命令。
I assume the reason for this design choice is:
The develop branch is created only once. No need for a helper command to publish it.
Feature branches get created all the time. Here, a helper command is, well..., helpful.
我认为这种设计选择的原因是:
开发分支只创建一次。不需要帮助命令来发布它。
功能分支一直在创建。在这里,一个帮助命令是,嗯...,很有帮助。
回答by Decebal
I found this cheatsheet very helpfull on understanding git flow : cheatsheet.
我发现这个备忘单对理解 git flow 非常有帮助:备忘单。
Provided that you respect git flow principles you shouldn't need to publish your developmentbranch, when collaborating you should publish a feature, when publishing to master you should use a release.
如果您遵守 git flow 原则,则不需要发布您的开发分支,合作时您应该发布一个feature,发布到 master 时您应该使用release。
That's how i use it.
这就是我如何使用它。
I hope this is helpfull to you.
我希望这对你有帮助。