git-cliff is a tool for generating change logs from commit history Difftastic

Ergonomics

  • Forgit is a zsh and fzf enabled command line tool that allows for more interactive git command use.
  • tig is a text-mode interface for git.
  • lazygit is a terminal UI for git

Commit Messages

Git Hacks

Add git repo on serverhacks

root@git:/home/git/private # mkdir blog.git
root@git:/home/git/private # cd blog
root@git:/home/git/private/blog # git init --bare --shared
Initialized empty shared Git repository in /home/git/private/blog/
root@git:/home/git/private/blog # cd ..
root@git:/home/git/private # chown -R git:git blog.git

Change git identity based on repohacks

To set a specific git identity and config based on the repo you are in you can use the includeIf directive in your .gitconfig. For example1:

[includeIf "hasconfig:remote.*.url:git@github.com:orgname/**"]
  path = ~/.config/git/config-gh-org

git-filter-repo for Rewriting Git Historyhacks

git-filter-repo is a standalone Python script that can be used to rewrite the history of a Git repository, similar to the BFG Repo-Cleaner tool. It provides a powerful set of filters that can be used to modify the repository history in various ways, such as changing the author name/email, rewriting commit messages, removing sensitive data, and more. Unlike the BFG Repo-Cleaner, git-filter-repo is actively maintained and recommended by the Git project. It’s designed to be more efficient and flexible than the BFG Repo-Cleaner, and can handle larger repositories more easily. To use git-filter-repo, you can clone the repository and run the git-filter-repo script with the desired filters and options. The script will rewrite the history of the repository based on the specified filters, and create a new repository with the modified history.

Repo can be found here: https://github.com/newren/git-filter-repo

A useful example of using it like a library to build more complex usages can be found here.

1. Mora, B. E. How I configure my Git identities. https://benji.dog/articles/git-config/ (2024).