Created
February 24, 2015 16:27
-
-
Save openam/bd4ab13ea4a1defc59dc to your computer and use it in GitHub Desktop.
Check for commits on one branch that are not in another branch, and export them to the desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ $# -lt 2 ]]; then | |
| echo " | |
| Usage: compare-branches baseBranch compareBranch | |
| Shows what commits exist in the second branch that are not in the first" | |
| exit | |
| fi | |
| FIRST=$1 | |
| SECOND=$2 | |
| echo "Generating logs in the desktop showing what commits are in branch '${SECOND}' that are not in branch '${FIRST}'" | |
| git log --right-only --cherry-pick --pretty=format:"%H|%an|%s" ${FIRST}...${SECOND} > ~/Desktop/${SECOND}.short.txt | |
| git log --right-only --cherry-pick ${FIRST}...${SECOND} > ~/Desktop/${SECOND}.long.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment