Skip to content

Instantly share code, notes, and snippets.

@lvitya
Last active June 13, 2017 14:32
Show Gist options
  • Save lvitya/66a9f519d30b7fd2c90d8f95a0b3a1a1 to your computer and use it in GitHub Desktop.
Save lvitya/66a9f519d30b7fd2c90d8f95a0b3a1a1 to your computer and use it in GitHub Desktop.
View commits graph starting from the given ancestor. That is you can see all feature branches based on the common master branch. Helps to track multiple feature branches, which have to be merged into master branch.
#!/bin/bash -x
# $1 == ancestor
BR_LIST=$(git for-each-ref --contains "$1" --format="%(refname)")
git log "$1"^! $BR_LIST --oneline --decorate --graph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment