Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does git-svn handle moved files

Tags:

git

svn

git-svn

Git doesn't explicitely track copied or moved files, but detect them for example with 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?

like image 971
dronus Avatar asked Apr 13 '11 16:04

dronus


2 Answers

git-svn will properly reference the file history if it can detect the link at the time you 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.

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.

like image 66
sam hocevar Avatar answered Nov 15 '22 10:11

sam hocevar


You mean to get an entry in SVN Log like the following:

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

Yes you get such a thing.

like image 22
khmarbaise Avatar answered Nov 15 '22 10:11

khmarbaise