简体   繁体   English

使用github的Git流 - 推送到中央仓库

[英]Git flow with github - pushing to central repo

I've setup a repository on Git hub and I'm using git flow. 我在Git hub上设置了一个存储库,我正在使用git flow。 I know how to create features, releases and hotfixes, however from what I've read so far it doesn't seem clear how you push to the central repository (github), therefore I've got a few questions: 我知道如何创建功能,发行版和修补程序,但是从我到目前为止所读到的内容看起来并不清楚如何推送到中央存储库(github),因此我有几个问题:

  1. Once a feature is finished and you have ran git flow feature finish how do you then push this to github? 一旦功能完成并且您已经运行git flow feature finish那么如何将其推送到github?
  2. Once it is pushed to Github do I ever need to pull from Github or do we never touch the central repo and simply use it so that other developers/servers can pull from it? 一旦它被推送到Github,我是否需要从Github拉出来或者我们是否从未触及中央存储库而只是使用它以便其他开发人员/服务器可以从中获取?
  3. How do the developers pull from the central repo using git flow? 开发人员如何使用git flow从中央仓库中撤出?

Thanks 谢谢

To push back to github, there isn't a real command in git-flow as it's just: 要回到github,git-flow中没有真正的命令,因为它只是:
git push origin develop if you just touched the develop branch and git push origin master if you also touched the master branch. git push origin develop如果你刚触及develop分支并且git push origin master如果你也触及了master分支,那么就会开发。 (I started using the branch name as per git 2.0 the default behavior of git push will change to not pushing all branch when do a git push) (我开始按照git 2.0使用分支名称,git push的默认行为将改为在执行git push时不推送所有分支)

If you work with a group of developers you always need to pull from the central repo before you do work as others might have pushed changes and you don't have them. 如果您与一组开发人员合作,您总是需要在工作之前从中央仓库撤出,因为其他人可能已经推动了更改并且您没有更改。 You can either do it by hand or use the git flow flag. 您可以手动执行或使用git flow标志。

If you start a new feature: 如果您开始新功能:
git flow feature start -F foo

This will fetch the develop branch and checks if your branch if equal to the remote branch, if it's not the feature won't start and you have to make sure they are. 这将获取开发分支并检查您的分支是否等于远程分支,如果不是该功能将无法启动而您必须确保它们是。

It's important to know the basics of git before you start using git-flow. 在开始使用git-flow之前了解git的基础知识非常重要。
I also suggest to read would Distributed Git - Distributed Workflows 我还建议阅读分布式Git - 分布式工作流程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM