Git Cheat turns your git alias config into a cheat sheet you can read in the terminal or export to markdown or html.
It is designed for exactly the workflow you described:
- Use git config as source of truth
- Keep docs close to aliases via comments
- Include global aliases and selected project-local aliases
- Keep a small local config of which project folders to include
This first version keeps things intentionally simple:
- One cheat-sheet set
- Global aliases included by default
- Add/remove project folders to include local aliases
- Aliases are included when tagged with a
cheatcomment
Only aliases with a cheat marker comment immediately above the alias line are shown.
Example:
[alias]
# cheat: Compact status output
st = status -sb
# cheat: Pretty one-line graph
lg = log --graph --oneline --decorate --all
# Not included (no cheat marker)
co = checkoutSupported marker forms:
# cheat# cheat: description; cheat; cheat: description
The optional description is shown in output.
Clone and install alias:
git clone https://github.com/yourusername/git-cheat.git
cd git-cheat
./bin/install_alias.shThe installer also writes a # cheat: cheat sheet generator marker comment
above the alias in your global git config so that git cheat show includes
the cheat command itself — try it right after install. Re-running the
installer is safe: the comment is only added if it isn't already there.
Manual alias setup:
git config --global alias.cheat '!bash /path/to/git-cheat/bin/git-cheat.sh'- Show help (this is also what bare
git cheatdoes):
git cheat
git cheat help- Render your cheat sheet in the terminal:
git cheat show- Show config path and setup guidance:
git cheat configure- Guided setup helper (recommended after first install):
git cheat editgit cheat edit shows where your global git config lives, prints the right
edit command for your $EDITOR/$VISUAL, lists every project repo you have
already added, and offers to open the global config in your default editor so
you can start adding # cheat: ... markers right away.
Set GIT_CHEAT_NO_PROMPT=1 to suppress the interactive prompt (useful in
scripts and CI).
- Add a project repo whose local aliases should be included:
git cheat config add /path/to/project- Remove a project repo:
git cheat config remove /path/to/project- List current config:
git cheat config list- Export:
git cheat export md ./git-cheat-sheet.md
git cheat export html ./git-cheat-sheet.htmlNotes:
- If output path is omitted, the file is saved to
~/Downloads(falling back to~/Desktop, then~). - After an html export the script prints the right
opencommand for your platform so you can preview it immediately.
Default config file path:
~/.config/git-cheat/config
Example:
# git-cheat config (v1)
include_global=true
project=/Users/you/code/project-a
project=/Users/you/code/project-b./bin/git-cheat_test.sh