The author wants to make a tool that can quickly find all changed files from the directory under git control and form an upgrade package to facilitate the upgrade work on the server.
(We need to copy the upgrade package to the server and directly overwrite the contents of the upgrade package to complete the upgrade)
In the past, this upgrade package was always created manually, which was very troublesome, especially if the files were scattered. .
General idea:
1. You can use git diff --name-only to get a list (only the list of files that have not been committed is displayed here)
crontabs/php/create_data_into_sku_flowtype_storage.php
crontabs/php/crontab_script_base_import_to_db.php
This list It contains all newly created or modified directories and files, just follow this list to "grab the medicine"
2. According to the information prompted in this file, decompose it line by line and get the corresponding path
crontabs/php/create_data_into_sku_flowtype_storage .php
Then, determine whether the parent path (crontabs/php/) specified by this information exists.
If it does not exist, create it one by one.
Then determine whether this is a directory. If so, add the corresponding directory to the target path (do not copy).
If it is not a directory (it is a file), then copy it.
Be careful not to copy the directory.
In addition, you can use git log --oneline to view the history
Reference:
Chen Jiebin, "git extracts the difference files between two versions and packages them", 2013-09-11, http://www.01happy.com /git-extract-different-files/
The above has introduced the automatic generation of the upgrade package git, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.