git add, commit and push commands in one?

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

    In Linux/Mac, this much practical option should also work

    git commit -am "IssueNumberIAmWorkingOn --hit Enter key
    > A detail here --Enter
    > Another detail here --Enter
    > Third line here" && git push --last Enter and it will be there
    

    If you are working on a new branch created locally, change the git push piece with git push -u origin branch_name

    If you want to edit your commit message in system editor then

    git commit -a && git push 
    

    will open the editor and once you save the message it will also push it.

提交回复
热议问题