Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get the change list when git push
# Find the common ancestor of current hash and origin/master
# 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`

This comment has been minimized.

Copy link

commented Sep 25, 2017


git diff ...origin/master --name-only --diff-filter=ACMRT

This comment has been minimized.

Copy link
Owner Author

commented Sep 26, 2017

@gucong3000 我试了下,貌似不行啊,输出是空的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.