marcin.codes

Git history as valuable documentation

2020-04-16T17:15:57.333Z

Git history as valuable documentation

I found out this great article about daily habits to make Git History valuable documentation.  Daily Habits to Turn Your Git History Into Valuable Documentation 

They recommend some nice actions you can take, to make your git history work for you, not the other way around. I will just summarize it here, for my/yours future reference :)

  1. “We recommend each message starts with a verb, in the present tense, and ends in a period.”
  2. “Capture “Why” in Your Git Commits” “Good docs create an environment where people feel guided and safe when changing the software, especially the newer members of the team.”

They also introduced some nice questions you can ask yourself before commit:

What constraints were present at the time of coding?
What other ways did I consider?
If I were reading this in a few months/years, what would I want to know?
  1. “Capture the Higher-Level “Why” in Git Pull Requests”

Useful Git commands:

  • git commit —-amend - amend last commit
  • git rebase -i HEAD~n - update any commit message n far away from HEAD

Written by Marcin Krawczyk.
Javascript Developer from Poland, living in Switzerland