如何自动化git命令

Tru*_*ran 0 git macos bash

有没有办法可以编写脚本来自动运行git命令?例如,如果我在我的终端,有没有办法可以运行类似于的命令:

run git push 这将自动为我运行命令:

git add .

git commit -m 'wip'

git push origin

等等

Vam*_*ire 5

当然,你可以写一个shell脚本来执行你想要的命令,或者你可以创建一个git别名git config --global alias.p '!git add . && git commit -m "wip" && git push origin',以便git p以后能够运行.