最佳的Git& Github上 [英] Best workflow with Git & Github

查看:165
本文介绍了最佳的Git& Github上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一些关于如何使用Git& GitHub。



我们是最近的svn转换器,它让我们很难理解如何最好地设置我们的日常工作流程。



这是一个小小的背景:我对命令行感到满意,我的团队对它很新颖,但可以遵循使用命令。我们都在与3个环境(开发,分期和生产)一起开展同一个项目。我们是开发者和开发者的混合体。设计师,所以一些人使用git GUI和一些CLI。

我们在svn中的设置如下所示:




  • 我们有一个用于开发,分期和生产的分支。

  • 当人们对代码有信心时,他们会提交然后将其合并到分段中。

  • 服务器会自行更新,并且在发布日(每周)我们会进行比较并将更改推送到生产服务器。



现在我设置了这些分支,并让服务器运行的进程,但实际的工作流程让我困惑不已。

似乎每次有人对文件进行更改时,都会创建一个新的分支,提交,合并和删除该分支。从我读过的内容他们可以在特定的提交(使用哈希)上做到这一点,我有这样的权利吗?这是一个可以接受的方式来处理与Git的事情吗?



任何建议将不胜感激。

解决方案

你可以从svn逐字复制你的工作流程。 Git可以做任何事情(但它可以做的比这更多!)。但是,尽管使用了CVS,但您的工作流程仍可以得到改进。



如果您想保留最少的分支数量(如果您刚接触git,实际上会简化在你所描述的工作流程中,我建议拥有三个开发者分支:devel-john,devel-mary等:

pre> devel-john> - \
\
devel-mary> ------>分期--->生产
/
devel-peter> - /

所有的开发改变都会被推送到中央仓库(即使是git也是一件好事),而且任何人愿意/有义务进行合并(例如,进入暂存分支)任何时候都可以合并。


I'm looking for some advice on how to properly structure the workflow for my team with Git & GitHub.

We are recent svn converts and it's kind of confusing how we should best set up our day-to-day workflow.

Here is a little background: I'm comfortable with command line and my team is pretty new to it but can follow use commands. We all are working on the same project with 3 environments (development, staging, and production). We are a mix of developers & designers so some use the git GUI and some the CLI.

Our setup in svn went something like this:

  • We had a branch for development, staging and production.
  • When people were confident with code they would commit and then merge it into the staging.
  • The server would update itself and on a release day (weekly) we would do a diff and push the changes to the production server.

Now I set up those branches and got the process with the server running but its the actual workflow that is confusing the hell out of me.

It seems like overkill that every time someone makes a change on a file they would create a new branch, commit, merge, and delete that branch. From what I have read they would be able to do it on a specific commit (using the hash), do I have that right? Is this an acceptable way to go about things with Git?

Any advice would be greatly appreciated.

解决方案

You can copy your workflow from svn verbatim. Git can do everything svn can (but it can do more than that!). But your workflow could be improved in spite of CVS used.

If you want to keep number of branches minimal (which in case you're new to git would in fact simplify things) in the workflow you have described I'd suggest to have (instead of one development branch) three per-developer branches: devel-john, devel-mary, etc:

devel-john >--\
               \
devel-mary >------> staging ---> production
               /
devel-peter >-/

This is convenient: all development changes would be pushed to central repository (which is often a good thing even for git) without conflicts and merged anytime by anyone who's willing/obliged to do the merging (for example into the staging branch).

这篇关于最佳的Git& Github上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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