git add, commit and push commands in one?

前端 未结 30 1398
隐瞒了意图╮
隐瞒了意图╮ 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 03:55

    For MAC VSC users the best setup is:

    1) press 'shift+cmd+P' and type:

    Shell Command: install 'code' command in PATH
    

    Press ENTER (this will install code command to get to the bash_profile easily)

    2 ) you can now run: code ~/.bash_profile to open the empty bash_profile

    3) enter a new function in there:

    function lazygit() {
        git add .
        git commit -m "$*"
        git push
    }
    

    4) now restart VSC

    5) make a change, save it and type lazygit message to run the three commands concurrently

提交回复
热议问题