简体   繁体   English

git-svn是否处理移动的文件

[英]Does git-svn handle moved files

Git doesn't explicitely track copied or moved files, but detect them for example with git log --follow . Git没有明确跟踪复制或移动的文件,但是例如使用git log --follow检测它们。 When using Git on an SVN Repo and pushing my changes with git svn dcommit , will SVN recognize those as copied files? 在SVN Repo上使用Git并使用git svn dcommit推送我的更改时,SVN会将这些更改为复制文件吗?

git-svn will properly reference the file history if it can detect the link at the time you git svn dcommit . git-svn将正确引用文件历史记录,如果它可以在你git svn dcommit时检测到链接。 If the only thing you do is move the file, it will work as expected and the SVN server will link file A to file B in its history. 如果您唯一要做的就是移动文件,它将按预期工作,SVN服务器将在其历史记录中将文件A链接到文件B.

However, if you also modify the file then squash the two commits before pushing them to SVN, then git may not properly guess that the file was renamed and you will get a deleted file and a newly created file with no apparent relationship in the SVN repository. 但是,如果您还修改了文件,然后在将它们推送到SVN之前压缩两个提交,那么git可能无法正确猜测文件已重命名,您将获得已删除的文件和新创建的文件,在SVN存储库中没有明显的关系。

You mean to get an entry in SVN Log like the following: 您的意思是在SVN Log中获取一个条目,如下所示:

   A /xxxx/xyz (from /xxxx/zzzz.xxx:5555)

Yes you get such a thing. 是的,你得到这样的东西。

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

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