Skip to content

Instantly share code, notes, and snippets.

@logicaroma
Created August 5, 2013 20:07
Show Gist options
  • Save logicaroma/6159120 to your computer and use it in GitHub Desktop.
Save logicaroma/6159120 to your computer and use it in GitHub Desktop.
Generate a changelog markdown based on git log alias. http://unruhdesigns.com/blog/2011/07/generating-a-project-changelog-using-git-log
# The Script
```sh
git log v2.1.0...v2.1.1 --pretty=format:'<li> <a href="http://github.com/jerel/<project>/commit/%H">view commit &bull;</a> %s</li> ' --reverse | grep "#changelog"
```
# A git alias for the command:
```sh
chlogm = !sh -c 'git log $1...$2 --pretty=format:\"%s [view commit](http://github.com/$3/$4/commit/%H) \"' -
```
## Usage of the alias:
```sh
git chlogm first_tag last_tag github_user github_repo
```
# Other logs
log-fancy = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --date=relative
changelog = !sh -c 'git log $1...$2 --pretty=format:\"%s [view commit](http://github.com/$3/$4/commit/%H) \"' -
mylol = log --graph --decorate --pretty=oneline --abbrev-commit --all
git-log-tags + --no-merges --format=%B > CHANGELOG.TXT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment