Skip to content

Instantly share code, notes, and snippets.

@devasat
Created May 21, 2017 01:37
Show Gist options
  • Save devasat/551a8e218ae226062fafde69645ba1e3 to your computer and use it in GitHub Desktop.
Save devasat/551a8e218ae226062fafde69645ba1e3 to your computer and use it in GitHub Desktop.
Helpful Git commands
# view commits that are on a release branch but not on master
git log --pretty=oneline --abbrev-commit origin/release/16.12.14 --not origin/master
# view commits that are on master but not on a release branch
git log --pretty=oneline --abbrev-commit origin/master --not origin/release/16.12.14
# view unique JIRA IDs mentioned in commit messages on a release branch
git log --pretty=oneline --abbrev-commit origin/release/17.1.12 --not origin/master | grep -o "PROJNAME.*" | sed -e "s/'/:/g" | cut -d: -f1 | tr ',' '\n' | sed -e 's/ //g' | sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment