简体   繁体   English

如果文件名更改,如何将更改从一个分支转移到另一个分支?

[英]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)?

Use git merge , git pull or git cherry-pick as you would normally would像往常一样使用git mergegit pullgit 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.

相关问题 如何使用Java将基于列名而不是按列索引的特定列从一个CSV文件转换为另一个CSV - How To Transfer specific Columns based on column name not by column index From One CSV File Into Another CSV Using Java 使用AS2传输协议将文件从一台计算机传输到另一台计算机 - Transfer file from one machine to another using AS2 transfer protocol 如何将值从一个JLabel传输到另一个JLabel? - How to transfer a value from one JLabel to another? 如何将阵列从一个 class 转移到另一个? - How to transfer array from one class to another? 如何将自定义 class 从一个文件传输到另一个文件 - How to transfer a custom class from 1 file to another 如何使用java I / O将文本从一个文件传输到另一个文件 - How to transfer text from one file to another using java I/O 如何使用 Java SFTP 库 JSch 将文件从一个目录传输到另一个目录? - How do I transfer a file from one directory to another using Java SFTP Library JSch? 无法使用Java代码将文件从一个地方传输到另一个地方 - Cannot transfer a file from one place to another using java codes 无法使用JAVA中的网络将文件从一台电脑传输到另一台电脑 - Unable to Transfer File from one pc to another using networking in JAVA 从一台linux机器到另一台linux机器的远程文件传输 - Remote File Transfer from one linux machine to another linux machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM