Share the _linux shell with git in the update package

Source: Internet
Author: User

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_HERENewer commit ID

OLD_COMMIT_ID_HEREOlder 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.