简体   繁体   English

将修补程序从master复制到sourcetree上的分支

[英]copy a hotfix from master to branch on sourcetree

I have made a quick-fix on master. 我已经对大师做了一个快速修复。 I'd like to copy that small fix to some other branches. 我想将该小补丁复制到其他分支。 I tried to push it to another branch by selecting the master>selecting the commit>push>check some branch>ok. 我试图通过选择master> select commit> push> check some branch> ok将其推到另一个分支。 but when I click over to the branch there are no changes to be pulled. 但是当我单击分支时,没有任何更改要提取。

After digging around I see this would have been easily accomplished with git-flow but now is too late and would require a whole other thread to figure out how to set up git-flow because my branch structure is different. 深入研究后,我发现使用git-flow可以轻松完成此操作,但现在为时已晚,因为我的分支结构不同,因此需要一个其他线程来确定如何设置git-flow。

What is the simplest way now to push the change I made to another branch? 现在,将我所做的更改推到另一个分支的最简单方法是什么?

I guess i can always just physically copy\\paste the changes but what is the correct way? 我想我总是可以物理复制/粘贴更改,但是正确的方法是什么?

Thanks! 谢谢!

If you can't merge, I would recommend cherry-pick. 如果您不能合并,我建议您选择樱桃。 Here's how to do it in SourceTree: 这是在SourceTree中执行的方法:

https://answers.atlassian.com/questions/308089/how-to-use-cherry-pick-in-sourcetree https://answers.atlassian.com/questions/308089/how-to-use-cherry-pick-in-sourcetree

And here's an explanation of cherry-pick: 这是关于摘樱桃的解释:

http://think-like-a-git.net/sections/rebase-from-the-ground-up/cherry-picking-explained.html http://think-like-a-git.net/sections/rebase-from-the-ground-up/cherry-picking-explained.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM