Automatically generate the upgrade package git

Source: Internet
Author: User
: This article describes how to automatically generate the upgrade package git. if you are interested in the PHP Tutorial, refer to it. I want to create a tool that can quickly find all the changed files in the directory controlled by git and form an upgrade package to facilitate the upgrade to the server.
(We need to copy the upgrade package to the server and directly overwrite the content of the upgrade package to complete the upgrade)
In the past, this upgrade package was always created manually, which is very troublesome, especially when files are scattered.
General Idea:
1. you can use git diff -- name-only to get a list (only the list of files without commit is displayed here)
Crontabs/php/create_data_assist_sku_flowtype_storage.php
Crontabs/php/crontab_script_base_import_to_db.php
This list contains all newly created or modified directories and files. you just need to follow this list to "take medicine ".
2. based on the information prompted in this file, perform line-by-line decomposition to obtain the corresponding path.
Crontabs/php/create_data_assist_sku_flowtype_storage.php
Then, determine whether the specified parent path (crontabs/php/) exists.
If it does not exist, it is created in sequence.
Determine whether the directory is used. If yes, add the corresponding directory under the target path (do not copy ),
If it is not a directory (a file), copy it.
Do not copy directories.
In addition, you can use git log-oneline to view the history.
References:
Chen Jiebin, git extracted the differences between the two versions of files and packaging, http://www.01happy.com/git-extract-different-files/

The above introduces the automatic generation of the upgrade package git, including the content, hope to be helpful to friends who are interested in the PHP Tutorial.

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.