用于每天将master变为功能的别名

时间:2017-06-21 03:33:13

标签: git

我们掌握分支并开发分支。开发人员通常会为任何新功能创建自己的分支,然后为此新分支创建拉取请求,以便将其合并到开发中。

由于其他开发人员不断添加新功能并将其合并到开发中,我需要一个别名,我可以每天早上运行,以使我的功能分支与开发分支保持同步。有人能为我提供使用rebase选项的别名吗?

谢谢!

2 个答案:

答案 0 :(得分:1)

设置别名。

$ git config alias.update "pull origin develop --rebase"

现在,当您想要使用feature分支更改来更新本地origin/develop分支时。只需运行:

$ git checkout feature 
$ git update

答案 1 :(得分:0)

您可以将配置中的 branch.autosetuprebase 设置为

git config  branch.autosetuprebase always

或在全球一级

git config --global branch.autosetuprebase always

这将强制所有新分支在发出pull命令时自动使用rebase 您始终可以使用get merge命令进行合并。

https://git-scm.com/docs/git-pull