Objective
I believe a lot of people have had this experience, when modified a pile of bugs, to update the code to the server, at this point, the simplest way is to upload the project file all at once, this way feasible, but not to take. Why, you know!
In fact, you can directly in the server git pull
code to update the code, but if you encounter the server is a Linux server and without UI interface, unless you command line instructions and git is familiar with, or encounter code conflict is more troublesome, small series this aspect of the level is limited. There are other reasons, of course, that are not recommended for this update.
Below, small series for everyone to introduce the use of Git to play the update package.
Packing principle:
Use git archive
output to change between two submissions
NEW_COMMIT_ID_HERE
Newer commit ID
OLD_COMMIT_ID_HERE
Older commit ID (this is the starting point for the update package)
Now I have two submissions (commit)
The first submitted ID is 438eac0 and a file is submitted
The second submitted ID is 4D5BAF6 and three files were submitted
Then follow the instructions in the package above:
Git archive-o update.zip 4d5baf6 $ (git diff–name-only 438eac0 4d5baf6)
If you execute the instructions, you will find one more Update.zip compressed file in the directory
Small edit to extract the file to see what content
is a small series of the second submitted file and directory, which shows that OLD_COMMIT_ID_HERE
only as a starting point for packaging, but does not contain OLD_COMMIT_ID_HERE
the content submitted.
Of NEW_COMMIT_ID_HERE
course OLD_COMMIT_ID_HERE
, and can be separated between multiple COMMIT
, so that you can play multiple COMMIT
content packaged into a compressed package.
Finally, as long as the extracted content through the FTP tool upload to the server.
Summarize
The content shown above is only a single code update, the actual update may also involve several aspects, such as database scripts, configuration files, etc., small series in this article will not be too much discussion. Interested students can Baidu or Google.
Conclusion
Thank you for your reading, I hope the content of this article for everyone's study and work can bring help. If you have questions to discuss, thank you for your support for the cloud-dwelling community.