[英]merge commits from one branch into another one
使用bitbucket和Atlassian SourceTree,我做到了:
01/July/2015 - Create the branch 'Branch01' from ' Develop'.
[ ... ] - Work on 'Branch01'.
01/Agost/2015 - Create the branch 'Brancho02' from 'Develop'.
[ ... ] - Work on 'Branch01' and 'Branch02'.
01/Oct/2015 - Merge 'Branch02' into 'Develop'.
我想将提交从Branch02转移到Branch01,而不将“ Branch01”合并到“ Develop”中
我怎样才能做到这一点?
如果合并时发现很多错误,是否可以撤消这些更改?
如果要从Branch02到Branch01进行任何特定的提交
git cherry-pick 'commit-id'
如果您需要将所有提交提交到Branch01
git checkout Branch01
git merge Branch02
因此将Branch02的所有更改引入Branch01
不幸的是,如果您发现错误或冲突,则只能通过执行此操作来重置合并
git reset --hard origin/master
因此您的合并将被还原,Branch01将恢复其原始状态
即使你可以使用
git reset --merge
希望你的工作顺利。 您可以撤消更改。
您可以执行以下命令
git checkout Branch01
git merge Branch02
而且你有它:-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.