How can I pull all remote changes with rebase instead of merge?

后端 未结 4 1265
臣服心动
臣服心动 2020-12-28 15:23

I can pull changes using git pull, but it merges my local commits. Is there a git rebase equivalent with which I can pull in remote changes?

4条回答
  •  误落风尘
    2020-12-28 16:15

    Instead of autosetuprebase, you can use the pull.rebase config option to change the behavior for every git pull (instead of only newly-created branches):

    [pull]
        rebase = true
    

    The difference is this will apply to non-tracking branches and any branches you had set up before enabling autosetuprebase. So if you really want pull --rebase to always be the default, pull.rebase is the way to go!

提交回复
热议问题