自动合并GitHub分支机构?

时间:2018-02-16 22:16:01

标签: git github git-branch git-merge

每次我提交时,是否有可用于自动将我的GitHub存储库中的master分支合并到dev分支的服务?我不想在我的计算机上不断运行脚本,尽管如果这是我可以使用它的唯一选择。我会提供更多细节,但我甚至不知道从哪里开始。

1 个答案:

答案 0 :(得分:2)

您想使用git Hooks

  

完成整个提交过程后,post-commit挂钩运行。

请尝试以下方法:

cd /path/to/project/

echo "#!/bin/sh"                > ./.git/hooks/post-commit
echo "git merge origin/master" >> ./.git/hooks/post-commit

chmod 770 ./.git/hooks/post-commit

每次提交后,会将origin/master合并到当前工作分支中。你可以明显地调整它。

相关问题