简体   繁体   中英

How to automate git commands

Is there a way I can write a script to automatically run git commands? For example, if I am in my terminal, is there a way I can run a command similar to:

run git push which will automatically run the commands for me:

git add .

git commit -m 'wip'

git push origin

etc.

Sure, you can either write you a shell script that does the commands you want or you can make a git alias like git config --global alias.p '!git add . && git commit -m "wip" && git push origin' git config --global alias.p '!git add . && git commit -m "wip" && git push origin' to be able to run git p later on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM