使用git和github进行工作流最佳实践? [英] Workflow best practice with git and github?

查看:163
本文介绍了使用git和github进行工作流最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用git和github与我的小团队开发人员进行项目。我忍不住想我们做得不对。我很想听听其他人如何在他们的项目中使用此工作流程。



我们如何使用它:
每次更改,合并回主,在本地提交并推送到我们的github回购。然后,我们进入我们的测试环境,并拉动github回购的主分支。我们还没有完全掌握 rebase fetch 标记



我想如何使用它:
我希望能够ssh进入不同的服务器,将特定的标记版本,例如阶段1拉入服务器。这是可能的,还是我需要两个不同的github回购?



您应该将 git pull 一个特定的分支插入到Web服务器中,或者创建一个新的别名到<$ c您可以在一个git仓库中控制候选版本或环境(测试,开发,生产)吗?您可以控制一个git仓库中的候选版本或环境(测试,开发,生产)吗?或者你需要多个?



如果拉是解决方案,你可以拉一个特定的标签

解决方案

基本上,您可以很好地使用一个中央GitHub存储库。


  • 标签是不可变的指针,它们可以随时使用(并推送),以便签出到任何测试或生产环境。这允许进行一些验证,但通常不会用于开发。

  • 拉一个分支意味着您可以在该分支中进行一些改进(由于一些代码位于生产环境中时进行了一些错误修正和调整),并将其推回给所有其他开发人员这样它就取决于你在这些服务器上所做的事情:只有验证(带有一个状态已被接受或被拒绝),或者还有进一步的发展。

    在任何情况下,具有适当命名约定的标签都可以跟踪历史记录中的特定提交,但每次需要隔离开发工作。


    I have been using git and github with my small team of developers for our projects. I can't help but think that we aren't doing it right. I am interested to hear how others use this workflow within their projects.

    How we use it: We branch before each change, merge back into the master, commit locally and push to our github repo. We then ssh into our testing environment and pull the master branch of the github repo. We haven't quite grasped rebase, fetch or tagging just yet.

    How I would like to use it: I would like to be able to ssh into the different servers and pull a specific tagged version, like "phase 1" into the server. Is this possible, or would I need two different github repos?

    Are you supposed to git pulla specific branch into the web servers or create a new alias to git push to?

    Can you control release candidates or environments (testing, development, production) within one git repository? or do you need multiple?

    If pulling is the solution, can you pull a specific tag ?

    解决方案

    Basically, you can very well function with one "central" GitHub repository.

    • Tags being immutable pointers, they can be used (and pushed) any time, in order to be checked-out to any testing or production environment. That allows some validation to take place but usually does not serve for development.
    • Pulling a branch means you can make some evolutions within that branch (due to some bugfix and adjustments to make once the code is on a production environment) and push it back for all the other developer's repository for them to pull back and take into account.

    So it depends what you are doing on those servers: only validation (with a status accepted or rejected), or also further developments.
    In every case, a tag with an appropriate naming convention is nice to keep track of specific commits in the history, but branches are necessary every time you need to isolate a development effort.

    这篇关于使用git和github进行工作流最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆