We have remote svn repository and we want it to convert to git. Could you please tell me how is it possible to do it on Windows? Thank.
Install application on Windows:
Find out the svn repository URL
and copy it
Something like this:
Invoke TortoiseGit Clone dialog
Right click on destination folder, e.g. D:\SVN\ToGit
, and Click Git Clone...
Check the From SVN repository
checkbox
If you copied the URL first, then invoke the clone dialog, TortoiseGit will get the copied URL from clipboard and paste it into the URL text field for you. So, you don't paste it by yourself. Just have look at it to see if it's correct.
And if you right click on destination folder, TortoiseGit also fill the Directory
text field for you. Also, take a look to see if it's what you want.
So, just check the From SVN repository
checkbox.
And if the svn repository has the standard layout, say trunk, tags, branches, you don't need to do anything further.
Click the OK button to go
Then, starting to clone a svn repository to git repository.
Something like this:
As you can see, TortoiseGit just properly uses Git for Windows command git svn clone
to clone it.
git.exe svn clone "svn://svn.code.sf.net/p/tortoisesvn/code/" "D:\SVN\ToGit\tsvn" -T trunk -b branches -t
So, basically, you can go Git Bash/CMD and re-use that command line, and also get the same result.
NOTE: If you can see the r1
, r2
, r3
..., you can stop the cloning anytime, and resume it later by using the same command line.
Clone a local svn repository
With TortoiseGit 2.4.4+
Just copy the svn local path into URL of Clone dialog. See:
Again, Check the From SVN repository
checkbox
Cloning:
TortoiseGit 2.4.4+ will use file:///
protocol to clone a local svn repository.
After you get a git repository, you can commit there. And push the commit back to origin svn repository by using TortoiseGit ->
SVN DCommit...
, something like svn commit
.
As you can see, the command is git svn dcommit
.
And if the origin svn repository has some new commit(s) need to update, you can use TortoiseGit ->
SVN Rebase
to fetch the svn commit and then merge/rebase on the latest commit. Something like svn update
.
It uses git svn fetch
then uses git rebase
to merge/rebase the fetched changes.
For command line, you could just use git svn rebase
.
Read Pro Git v2 - Chapter 9 for more information and examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With