Skip to content
Peter R edited this page May 6, 2020 · 4 revisions

git policies and recommendations

This is written minding people who have write access to Elmer github repository.

Policies

  1. Always use --no-ff when merging to devel branch.

    For example, in devel branch, a branch named feature1 should be merged to devel as follows:

     $ git merge --no-ff feature1
    

Recommendations

  • Direct commits in devel branch are only for compact fixes

  • Make feature branches when working on new features or larger fixes

  • When a feature branch is merged back to devel (see policy 1.), and is no longer developed, delete the feature branch.

  • When working locally on a remote tracking feature branch, pull with --rebase to apply your local changes on top of remote. This way we avoid possibly unnecessary merge commits in feature branches.

    For example, assume branch feature2:

      $ git pull --rebase
    
      First, rewinding head to replay your work on top of it...
      Applying: test-commit
    
  • Even if you're hesitant to merge your feature branch (e.g. a PhD thesis) to devel, please try to merge devel frequently to your feature branch to minimize merge conflicts in the future.