Created
September 22, 2017 04:58
-
-
Save xcatliu/ddc2aec4e4cde0824429477f7ea233cd to your computer and use it in GitHub Desktop.
Get the change list when git push
This file contains 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
# Find the common ancestor of current hash and origin/master | |
# https://stackoverflow.com/questions/1549146/find-common-ancestor-of-two-git-branches | |
# Command inside `` will be executed and pass to the variable | |
common_ancestor=`git merge-base HEAD origin/master` | |
# --diff-filter=ACMRT Only show files which is appended, copied, modified, renamed or type-changed | |
changelist=`git diff $common_ancestor HEAD --name-only --diff-filter=ACMRT` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
貌似可以简化为一行