Pull, rebase, push, in one command (or just a few)

后端 未结 2 633
余生分开走
余生分开走 2021-02-07 01:31

When using Git, I often find myself doing the following when working in master:

# work work work...
$ git checkout -b temp
$ git commit -a -m \'more         


        
2条回答
  •  南旧
    南旧 (楼主)
    2021-02-07 01:57

    You can at least optimize the rebasing: git pull --rebase

    I'm not exactly sure how you like things, but I like my workflow sort of like this:

    git checkout -b temp
    git commit -a -m 'more work done'
    git pull --rebase origin master
    

    That way I keep my focus on the branch at hand.

    Then later, I do

    git checkout master
    git pull origin master
    git merge temp
    

    etc.

提交回复
热议问题