During the development process, it is often necessary to update multiple git projects at the same time. It is cumbersome to open each project and manually pull the updates each time. So I wrote a script to make it easier to update with just one click.
Windows#
The script is as follows:
#!/bin/bash
echo "echemi_api_backstage" && cd /c/dev/codeup/echemi_api_backstage && git pull --all && echo ""
echo "echemi_api_cmstop" && cd /c/dev/codeup/echemi_api_cmstop && git pull --all && echo ""
echo "echemi_api_es" && cd /c/dev/codeup/echemi_api_es && git pull --all && echo ""
echo "echemi_api_supplier" && cd /c/dev/codeup/echemi_api_supplier && git pull --all && echo ""
echo "echemi_api_third_party" && cd /c/dev/codeup/echemi_api_third_party && git pull --all && echo ""
echo "echemi_api_web" && cd /c/dev/codeup/echemi_api_web && git pull --all && echo ""
echo "echemi_backstage" && cd /c/dev/codeup/echemi_backstage && git pull --all && echo ""
echo "echemi_eu" && cd /c/dev/codeup/echemi_eu && git pull --all && echo ""
echo "echemi_pay" && cd /c/dev/codeup/echemi_pay && git pull --all && echo ""
echo "echemi_supplier" && cd /c/dev/codeup/echemi_supplier && git pull --all && echo ""
echo "echemi_ucenter" && cd /c/dev/codeup/echemi_ucenter && git pull --all && echo ""
echo "echemi_user" && cd /c/dev/codeup/echemi_user && git pull --all && echo ""
echo "echemi_web_en" && cd /c/dev/codeup/echemi_web_en && git pull --all && echo ""
echo "echemi_web_zh" && cd /c/dev/codeup/echemi_web_zh && git pull --all && echo ""
echo "echemi_mail_system_analyze" && cd /c/dev/codeup/echemi_mail_system_analyze && git pull --all && echo ""
echo "echemi_mail_system_batch" && cd /c/dev/codeup/echemi_mail_system_batch && git pull --all echo ""
echo "echemi_wechat" && cd /c/dev/codeup/echemi_wechat && git pull --all echo ""
echo "echemi_api_wechat" && cd /c/dev/codeup/echemi_api_wechat && git pull --all echo ""
In the script, each line represents a git pull operation for a project. If you need to add or remove projects, simply delete the corresponding line.
In each line, the text in quotes after echo
is the prompt message. I wrote the project name so that it is easy to know which project is being updated when running the script. /c/dev/codeup/echemi_api_backstage
is the path where the project is located. In Windows, if the path is
C:\dev\codeup\echemi_api_backstage
Then right-click, go to "Open with" and select "Git for Windows" to run.
The result of running the script:
Download Link#
I have compressed the script and uploaded it to a cloud storage. Feel free to download it if you need it.
Download: https://banmiya.lanzoum.com/iV4kv0yxv0hg
Password: bfh9