I. Git workflow - 24CaretSolutions/2b_n4tive GitHub Wiki

Branch model and naming convention

For git branches strategy use this example

A few refinement to the text:

  • name of development branch is dev
  • use - as a words separator and _ as a separator for prefix and branch name
  • use pattern ft_*** for naming feature branches, keep it short and sweet, use nouns and adjectives to describe a new feature (eg ft_my-awesome-toggle that could be reduced to ft_aw-toggle)
  • use pattern rc_*.* for naming release branches (eg rc_0.5)
  • use pattern hf_*.*.* for naming hotfix branches (eg hf_0.5.1)
  • an issue branch may be created from a release branch if it makes sense and it takes more than one commit to resolve the issue, in this case for the branch name use prefix is with opened issue number (eg is_155)

Release, issue and hotfix branches have short lifetime period as opposed to feature branches which lifetime can last through several releases. Partly implemented features can be included into current release if necessary.

Creating commits

Don't put big chunk of code that you've written into one commit. Split it into small completed well-described steps, so your teammates would easily understand changes that you've made just from reading commit's names. If you fix any open issues on GitHub, please reference an issue number in your commit comment or at least in comment to pull request. See this handy way to do it.

Merging branches

In order to merge any branch in dev or master open a new pull request and shortly describe all changes that are made in the branch if it is not clear from the branch name. Assign two other team members for a code review and wait for their responses. Resolve all arisen question about your code and make necessary changes, but feel free to argue. After everyone agrees close pull request and merge branches. Don't forget to delete a remote branch after merging it and closing pull request.

Note, before creating pull request pull recent changes in target branch from remote repo and merge it into your current brach locally in order to resolve any possible conflicts in the code.