Git notes

git
notes
Author

Martin Proks

Published

July 18, 2024

If you have ever written any code or small software, chances are you have used some form of version control such as Git or Mercurial. Below I summarize random article, snippets or tools I find usefull when working with Git.

Articles

Snippets

Avoid merging with rebase

Typical scenario, you are working on some code, you decide you are ready to commit push your changes to common branch (main, master, dev) and surprise. Someone else already pushed new changes to the branch and you don’t have the latest working state.

In case you and the other developer worked on different parts of the code, instead of standard git pull, try git pull --rebase. By doing so, you will avoid creating an extra merge commit, which can make the git tree cleaner. For visual example, see this Youtube video.

Tools

  • git-cliff: Customizable changelog generator