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