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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 15:27:16  来源:igfitidea点击:

How to push the "develop" branch to the remote "origin"?

gitgithubgit-flow

提问by AdamT

When I do git flow initit creates a masterand developbranches. 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 masterI have masterin my origin but not the developbranch. Is there a git flow publishfor the developbranch? All I'm seeing are publishfor featureor releasebranches. Does git-flow want me to just use regular git and do git push origin develop?

当我这样做时,git flow init它会创建一个masterdevelop分支。当我添加遥控器时,我会这样做git remote add origin [email protected]:NewB/our-repo.git。现在我在本地存储库上初始化了 git flow,并且添加了远程存储库。我做后git push -u origin master我有master我的起源而不是develop分公司。有没有git flow publishdevelop分支?我所看到的都是publish为了featurerelease分支。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.

我希望这对你有帮助。