git add, commit and push commands in one?

前端 未结 30 1491
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 03:15

Is there any way to use these three commands in one?

git add .
git commit -a -m \"commit\" (do not need commit message either)
git push

Som

30条回答
  •  青春惊慌失措
    2020-12-02 04:16

    Write a small script named gitpush.sh with below lines and add it your ~ directory.

    echo $1
    git add .
    git commit -m "$1"
    git push
    

    Now add an alias in ~/.bashrc like below :

    alias gitpush='~/gitpush'
    

    Now from any git repository just write gitpush "message" .

提交回复
热议问题