Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

# good - ensures that a merge commit is created

$ git merge --no-ff my-branch

# bad

$ git merge my-branch

Keep Commit History (per Monthly Architect's Meeting of 3/15/21)

When committing during the process of PR reviews, try to keep the commit history to make it easier for reviewers to see and follow the prior feedback conversations.  This means that, in general (subject to discusssions between committers and reviewers), don't squash the commit history until the PR is approved.  Also, don't force push the updates during the review/feedback process.  Instead, when making commits during the review process, follow the following commit process:

  • Make commits with your new commit comments:  git commit -s -m "your review comment with appropriate semantic version type/scope tags"
  • Commit without a force:  git push origin yourbranch (vs git push -f origin yourbranch)
  • On the last commit when the review has been completed, do a force push in order to rebase:  git push -f origin yourbranch

At the end of the review process, use the GitHub Merge button's options to squash the commit history (see below).

Image Added

Miscellaneous

  • Be consistent. This is related to the workflow but also expands to things like commit messages, branch names and tags. Having a consistent style throughout the repository makes it easy to understand what is going on by looking at the log, a commit message etc.
  • Test before you push. Do not push half-done work.
  • Use annotated tags for marking releases or other important points in the history. Prefer lightweight tags for personal use, such as to bookmark commits for future reference.
  • Keep your repositories at a good shape by performing maintenance tasks occasionally:

...