我将master
分括为feature
。然后,我将feature
分支为feature2
。现在我想将所有更改到master
。我怎么做?我以为我会这样做:
git rebase master feature #to make sure history is linear
git rebase feature feature2 #to make sure history is linear
git checkout feature
git merge feature2 --ff-only
git checkout master
git merge feature --ff-only
这可以解决这个问题吗?我希望我的历史是线性的,因为我使用git-svn并且我听到非线性历史会混淆它。
答案 0 :(得分:1)
那会让你到达你想去的地方。您可以省略feature2的合并 - >功能并将feature2直接合并到master中,如果你想要一组稍微简单的命令。
git rebase feature feature2 # Ensure that all feature changes are
# included in feature2
git rebase master feature2 # Create a linear history
git checkout master
git merge feature2 # Merge feature2, which contains feature,
# into master