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
Vue The difference between single page and multi page 0.96OLED display -4 Line SPI explain R In language Axis() Detailed explanation of function parameters JAVA Snake games ( Source code + notes )C++ vector Simulation Implementation of class javascript Adding and deleting form information CCF A series of questions --2016 year 4 Month 1 Calculation of break point postman Interface test get timestamp and MD5 encryption 【 Recommended benefits 】c++ use easyx Making pixel birds , Simple hands on games TCP/IP There are so many loopholes in the agreement ?