[英]How to transfer changes from one branch to another if file name changed?
I have branch a, where I'm work with file1.我有分支 a,我在那里使用 file1。 Another man work with similar branch b.
另一个人在类似的分支 b 工作。 He made many changes there and renamed file1 to file2.
他在那里进行了许多更改,并将文件 1 重命名为文件 2。 I should checkout to his branch and transfer my changes to his branch.
我应该结帐到他的分行并将我的更改转移到他的分行。 How can I do this?
我怎样才能做到这一点? As I understand, stash is not a solution, because file name changed and after stash applying file doesn't appear.
据我了解,stash 不是解决方案,因为文件名已更改,并且在 stash 应用文件后不会出现。 How to transfer changes from that file1(branch a) to file2(branch b)?
如何将更改从该文件 1(分支 a)传输到文件 2(分支 b)?
git merge
, git pull
or git cherry-pick
as you would normally wouldgit merge
、 git pull
或git cherry-pick
...to bring changes from one branch to another. ...将更改从一个分支带到另一个分支。 Git is usually smart about detecting the name changes and will merge the changes and the name change.
Git 通常很聪明地检测名称更改,并将合并更改和名称更改。 If there is a conflict, you will have to handle it.
如果有冲突,你将不得不处理它。 It can be a little confusing, so using a good merge tool helps.
这可能有点令人困惑,因此使用好的合并工具会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.