Best workflow with Git & Github

后端 未结 5 952
天命终不由人
天命终不由人 2020-12-24 14:39

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

5条回答
  •  囚心锁ツ
    2020-12-24 14:58

    The ideas to keep in mind when working with a DVCS are:

    • distribution: even if you have one central GitHub, the developper are not limited to publish (push) only to that GitHub repo. They can fork the repo and publish in their own version (while fetching from the official central GitHub repo -- called "upstream").
      The advantage is they can rewrite history (reset, rebase --onto, rebase -i, ...) as many times as they want, in the end, they will make a pull request, allowing an integrator to manage their changes.

    • one of publication: in your own local repo, you can setup as many branches as you want (not one for every file modification, of course, but one for any new task or set of tasks you need to develop).
      But you can also set public branches that will be pushed ("published") to your remote repo.
      See this question on Git workflow, and also JC Hamano's articles on remote branches:
      o Fun with remote branches (1)
      o Fun with remote branches (2)
      The phrase "When people were confident with code they would commit and then merge it into the staging" should not apply with a DVCS: commit early, commit often, but push ("publish") only when you want.

提交回复
热议问题