Git Export the difference file between the two versions and package the publisher

1. View version
$ git log --pretty=oneline
2. Difference file and package

When you publish code, you can use the following command , Export the last submitted modified file , Export code merged from other branches
git archive -o ../update.zip HEAD $(git diff --name-only HEAD^)

If you need to release a few git Version code , You can export the specified submission with the following command id Between the modified file
git archive -o ../update.zip NEW_COMMIT_ID_HERE $(git diff --name-only
OLD_COMMIT_ID_HERE NEW_COMMIT_ID_HERE)
perhaps ( recommend ),linux There is a command provided xargs It can convert the output of the previous command into the parameters of another command , In this way, you can use the following command .
git diff --name-only OLD_COMMIT_ID_HERE  NEW_COMMIT_ID_HERE | xargs tar -zcvf
../update.tar.gz git diff --name-only OLD_COMMIT_ID_HERE  NEW_COMMIT_ID_HERE|
xargs zip update.zip
OLD_COMMIT_ID_HERE   This is the old version number

NEW_COMMIT_ID_HERE   This is the version number that cannot be sent to that version

 

Technology
©2020 ioDraw All rights reserved
Java realization PDF Online preview ( Four methods ) Android Development — Display food information according to customer budget spark.sql.shuffle.partitions and spark.default.parallelism The difference between Big data environment --- data warehouse (hive+mysql+hadoop) The construction of Children programming children's learning route What do you do in Shanghai to make money fast ? this 10 You can have a try ! Advanced programmer - Deep understanding of data structure After the outbreak Which programming has a bright future 2020 Nobel Prize in physiology or medicine announced Trump's "VIP therapy ": Is receiving a drug treatment that has not yet been approved