2014-09-30 83 views
3

什么是合并hotfix支进master/develop的最佳做法?Git的修补程序分支合并

我需要把它合并成两个分支

hotfix → master 
hotfix → develop 

或之后合并master再到develop

hotfix → master → develop 
+0

这取决于你如何使用开发和掌握。 – taskinoor 2014-09-30 10:16:56

+0

@taskinoor我根据[成功的git分支模型]使用它们(http://nvie.com/posts/a-successful-git-branching-model/)。 – 2014-09-30 10:35:28

回答

0

您可以合并的修补程序分支到两个masterdevelop(根据流行successful git branching model

git checkout master 
git merge --no-ff hotfix 

git checkout develop 
git merge --no-ff hotfix 

然后,您可以安全地删除您的修补程序的分支。

或在developmaster分支上使用git cherry-pick <hotfix-commit-hash>Cherry-picking是将单个/几个提交(s)带入分支的最简单方法。

+1

同意,你有关于'修补程序→主人→发展'的任何评论# – 2014-09-30 10:39:38

+0

我希望你的意思是说“樱桃采摘是最糟糕的方式”。这种模式不是一个好策略。 – 2014-09-30 15:55:14

+0

我不认为这回答了OP的问题。我认为这两种合并策略在技术上具有相同的结果。 – rcourtna 2014-12-11 23:19:23