Generate clean, conventional changelogs from your current branch vs master, with optional --author and --name flags.
git config --global alias.changelog '!f() { author=""; show_name="false"; while [ $# -gt 0 ]; do case "$1" in --author) author="--author=$2"; shift 2 ;; --name) show_name="true"; shift ;; *) break ;; esac; done; if [ "$show_name" = "true" ]; then git log master..HEAD --pretty=format:"- %s (@%an) (%h)" --no-merges --first-parent $author --grep="^feat\\|^fix\\|^docs\\|^style\\|^refactor\\|^perf\\|^test\\|^chore"; else git log master..HEAD --pretty=format:"- %s (%h)" --no-merges --first-parent $author --grep="^feat\\|^fix\\|^docs\\|^style\\|^refactor\\|^perf\\|^test\\|^chore"; fi; }; f'-
Compares current branch with
master. -
Filters for conventional commit types:
feat,fix,docs,style,refactor,perf,test,chore
-
Supports:
--author "Name"β filter by author.--nameβ append Git author username (as@Name).
-
Excludes merge commits.
-
Uses only first-parent commits.
git changeloggit changelog --author "Alice"git changelog --namegit changelog --author "Alice" --name- feat: add user profile page (a1b2c3d)
- fix: resolve login redirect loop (d4e5f6g)
- docs: update README with setup instructions (h7i8j9k)- feat: add user profile page (@alice) (a1b2c3d)
- fix: resolve login redirect loop (@bob) (d4e5f6g)
- docs: update README with setup instructions (@alice) (h7i8j9k)- feat: add user profile page (@alice) (a1b2c3d)
- docs: update README with setup instructions (@alice) (h7i8j9k)