Automatically generate upgrade package git

Source: Internet
Author: User
I want to make a tool that can quickly get from the git-controlled directory, find all the changed files, and form an upgrade package to facilitate the upgrade work on the server.
(We need to copy the upgrade package to the server and then overwrite the contents of the upgrade package directly to complete the upgrade)
Previously this upgrade package was always created manually, which is cumbersome, especially if the files are more fragmented.
General idea:
1. You can use Git diff--name-only to get a list (this shows only a list of files that have not yet been commit)
crontabs/php/create_data_into_sku_flowtype_storage.php
crontabs/php/crontab_script_base_import_to_db.php
This list contains all new or modified directories and files, just follow the list "prescription".
2. According to the information prompted in this file, progressive decomposition to get the corresponding path
crontabs/php/create_data_into_sku_flowtype_storage.php
Then, determine if this information specifies whether the parent path (crontabs/php/) exists.
Does not exist, it is created in turn.
Then determine if this is a directory, and if so, add the corresponding directory under the target path (do not copy),
If it is not a directory (it is a file), copy it.
Note that catalogs do not replicate.
Alternatively, you can use git log--oneline to view the history
Resources:
Chen Jiebin, "Git extracts the diff files from two versions and packs", 2013-09-11, http://www.01happy.com/git-extract-different-files/

The above describes the automatic generation of the upgrade package git, including aspects of the content, I hope to be interested in PHP tutorial friends helpful.

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