Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Export Update base on Commits
#you start job at 9AM. U did 5 commits every hour
#so can export from latest to the 9am commit id
#
#
#commit_id_5
#commit_id_4
#commit_id_3
#commit_id_2
#commit_id_1
#commit_id_0 (9AM)
git diff --name-only $commit_id_3
#^ so this command print all files commited from commit_id_5 to commit_id_3
git diff --name-only $commit_id_1
#^ so this command print all files commited from commit_id_5 to commit_id_1
git diff --name-only $commit_id_1 > updatelist.txt
#^ write terminal output to the file named as 'updatelist.txt'
zip update.zip $(cat updatelist.txt)
#^ zip files in the list
# credit - http://ihsanberahim.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment