SVN to Git migration

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

SVN to Git migration

SmartGit mailing list
I have a repository I have been using for about 2 years now.  I never knew anything about Git or SVN.  So at the time the repo was pretty much a place to store files with some version control to see and track changes.  If I wanted to move the files I simply used TortoiseSVN to add a folder with files in it and deleted the old folder.  There was no branching or maintaining of trunk, branches and such.
 

 Because of all the orphaned files, folders, and history I feel it's going to be impossible for me a novice to Git to convert the repo.  I might be able to do it if I knew pearl, ruby, and other scripting but I don't I'm afraid.  So I downloaded the trial to see how it would handle the repo.
 

 
 I have looked at the rather http://git-scm.com/book/en/Git-and-Other-Systems-Git-and-Subversion http://git-scm.com/book/en/Git-and-Other-Systems-Git-and-Subversion and even your documentation http://www.syntevo.com/smartgithg/documentation/6/show?page=concepts-svn but I have yet to find simple step by step instructions that clone my repo without any issues.  I wouldn't expect it to be organized, just that I can do it without coming across a warning that something is not configured or set up.
 

 I dislike all the documentation I have found so far.  Sometimes they have linux commands but I use Windows 7. There examples show what the command will do when used and it indicates what the command line parameters do.  They never, not once, give you the 10 steps to actually do it in the order you should do them.
 

 I tried to clone just one small folder to test with so I could keep it simple to start with.  I don't know how to do it from the command line this is the best I can do.  Also these instructions are a compilation of many StackOverflow and other posts.  Nobody has ever posted them in this order.  In fact I'll bet I need to be typing git config and setting up all kinds of upstream to remotes and origins and branches before I use fetch.  Nobody ever give one complete step by step set of instructions to clone an SVN.
 

 git svn init http://skyrim-plugin-decoding-project.googlecode.com/svn/UESPWiki/ http://skyrim-plugin-decoding-project.googlecode.com/svn/UESPWiki/
 git svn fetch --authors-file=../authors.txt

 git checkout git-svn
 git checkout -B master --force # because I had no commits nothing to loose and it errors if I use -b
 git pull
 git push --force
 

 I even saw one place say to do "git branch -d git-svn" and I can't because that isn't a valid branch.  Nor can I merge git-svn with master.  Using the command line I noticed that I can't get the files from the git-svn folder to the branch where I want very easily.  Using a lowercase 'b' does not work and I get an error that master already exists.  I had to go with "git checkout -B master --force" and when I finish those commands I am able to see the commits on my Repo.
 

 When I clone with SmartGit I can't get past "git checkout git-svn" before I am unable to get the GUI to do what I expect.  I don't see any commits show up on GitHub at all.  I also noticed looking at the log that it does not blame the proper person.
 

 SVN will allow you to commit multiple files and folders to multiple branches all in one commit.  Because of that there might be multiple files in several folders that served as developmental branches.  It also lets you put multiple folders for the same organization instead of it being broken up into groups withing the organization.
 

 So here are the things I feel will be important for me to use the program
 

 The ability to specify a blame file or some kind of text file for the authors of the commits on the SVN
 As I go through each commit from the SVN I need the ability to specify that 4 of the files need to go to one branch and the other files go to another branch
 The ability to specify which folders go to which repository within the organization. The ability to make the changes without getting warnings and notifications that there was an issue so the operation can't be performed

 The last one is probably the most import for me.  Because I am new to Git I don't know the jargon for Git so I am somewhat lost.  Maybe by making the right changes using git config, or doing whatever "Cherry Picking" does and making complex scripts I might be able to get the results I want.  
 

 However, I don't know how to do any of that.  I am looking for an interactive GUI that is easy to configure and will do everything you would need to do from the command line.  If I need to set up and upstream, orgin, remotes, and refs sure I can stumble along and maybe get it right if all the planets are in alignment at that moment.  I feel that if I want something to happen and 5 operations need to happen before I can do that, the it should be happening automatically transparent to me while I am using the GUI.
 

 Can SmartGit help me?  Are there video tutorials of any kind?
Reply | Threaded
Open this post in threaded view
|

Re: SVN to Git migration

SmartGit mailing list
Have you tried to, from the repositories menu in smartgit (best use newest
version), invoke "clone" and simply giving it the address to the root of
your repo (the address that you use with your svn client as well)? Best to
do root, and not any deeper folders.

That worked just fine for me with a sourceforge svn project.

Best,
Dee


On Thu, Jul 17, 2014 at 3:39 PM, [hidden email] [smartgit] <
[hidden email]> wrote:

>
>
> I have a repository I have been using for about 2 years now.  I never knew
> anything about Git or SVN.  So at the time the repo was pretty much a place
> to store files with some version control to see and track changes.  If I
> wanted to move the files I simply used TortoiseSVN to add a folder with
> files in it and deleted the old folder.  There was no branching or
> maintaining of trunk, branches and such.
>
>
> Because of all the orphaned files, folders, and history I feel it's going
> to be impossible for me a novice to Git to convert the repo.  I might be
> able to do it if I knew pearl, ruby, and other scripting but I don't I'm
> afraid.  So I downloaded the trial to see how it would handle the repo.
>
>
> I have looked at the rather
> http://git-scm.com/book/en/Git-and-Other-Systems-Git-and-Subversion and
> even your documentation
> <http://www.syntevo.com/smartgithg/documentation/6/show?page=concepts-svn> but
> I have yet to find simple step by step instructions that clone my repo
> without any issues.  I wouldn't expect it to be organized, just that I can
> do it without coming across a warning that something is not configured or
> set up.
>
> I dislike all the documentation I have found so far.  Sometimes they have
> linux commands but I use Windows 7. There examples show what the command
> will do when used and it indicates what the command line parameters do.
>  They never, not once, give you the 10 steps to actually do it in the order
> you should do them.
>
> I tried to clone just one small folder to test with so I could keep it
> simple to start with.  I don't know how to do it from the command line this
> is the best I can do.  Also these instructions are a compilation of many
> StackOverflow and other posts.  Nobody has ever posted them in this order.
>  In fact I'll bet I need to be typing git config and setting up all kinds
> of upstream to remotes and origins and branches before I use fetch.  Nobody
> ever give one complete step by step set of instructions to clone an SVN.
>
>
> git svn init
> http://skyrim-plugin-decoding-project.googlecode.com/svn/UESPWiki/
>
> git svn fetch --authors-file=../authors.txt
>
> git checkout git-svn
>
> git checkout -B master --force # because I had no commits nothing to loose
> and it errors if I use -b
>
> git pull
>
> git push --force
>
>
> I even saw one place say to do "git branch -d git-svn" and I can't because
> that isn't a valid branch.  Nor can I merge git-svn with master.  Using
> the command line I noticed that I can't get the files from the git-svn
> folder to the branch where I want very easily.  Using a lowercase 'b' does
> not work and I get an error that master already exists.  I had to go with "git
> checkout -B master --force" and when I finish those commands I am able to
> see the commits on my Repo.
>
> When I clone with SmartGit I can't get past "git checkout git-svn" before
> I am unable to get the GUI to do what I expect.  I don't see any commits
> show up on GitHub at all.  I also noticed looking at the log that it does
> not blame the proper person.
>
> SVN will allow you to commit multiple files and folders to multiple
> branches all in one commit.  Because of that there might be multiple files
> in several folders that served as developmental branches.  It also lets you
> put multiple folders for the same organization instead of it being broken
> up into groups withing the organization.
>
> So here are the things I feel will be important for me to use the program
>
>
>    1. The ability to specify a blame file or some kind of text file for
>    the authors of the commits on the SVN
>    2. As I go through each commit from the SVN I need the ability to
>    specify that 4 of the files need to go to one branch and the other
>    files go to another branch
>    3. The ability to specify which folders go to which repository within
>    the organization.
>    4. The ability to make the changes without getting warnings and
>    notifications that there was an issue so the operation can't be performed
>
> The last one is probably the most import for me.  Because I am new to Git
> I don't know the jargon for Git so I am somewhat lost.  Maybe by making the
> right changes using git config, or doing whatever "Cherry Picking" does and
> making complex scripts I might be able to get the results I want.
>
> However, I don't know how to do any of that.  I am looking for an
> interactive GUI that is easy to configure and will do everything you would
> need to do from the command line.  If I need to set up and upstream, orgin,
> remotes, and refs sure I can stumble along and maybe get it right if all
> the planets are in alignment at that moment.  I feel that if I want
> something to happen and 5 operations need to happen before I can do that,
> the it should be happening automatically transparent to me while I am using
> the GUI.
>
> Can SmartGit help me?  Are there video tutorials of any kind?
>
>  
>
Reply | Threaded
Open this post in threaded view
|

Re: SVN to Git migration

SmartGit mailing list
> Have you tried to, from the repositories menu in smartgit (best use newest version), invoke "clone" and > simply giving it the address to the root of your repo (the address that you use with your svn client as well)?
 > Best to do root, and not any deeper folders.
 

 i was kind of discussing the complexities of my issue and asking if SmartGit cold help.  I see that in the program and I can set that.  However, where does that apply to my question so I can use that as one of the steps.  My problem is that the steps I use to create the Repo are clearly wrong.  I have had little luck finding the exact steps I need.
 

 For example today I did some more reading and I thought I would make a test repo, and then import the 36 commits from the URL I provided.  I realize that using the root of the SVN would be better but I want to get it to work first before I try it on the whole thing.
 

 Here are the new steps I though might work.
 

 git svn init http://skyrim-plugin-decoding-project.googlecode.com/svn/UESPWiki/ 
 git remote add origin https://github.com/TES5Edit/TES5Edit-Test.git
 git svn fetch --authors-file=../authors.txt
 git checkout git-svn
 git checkout -b master
 git pull
 git push --force
 

 That failed on step #2.
 

 [core]
 repositoryformatversion = 0
 filemode = false
 bare = false
 logallrefupdates = true
 symlinks = false
 ignorecase = true
 hideDotFiles = dotGitOnly
 [svn-remote "svn"]

 url = http://skyrim-plugin-decoding-project.googlecode.com/svn/UESPWiki
 fetch = :refs/remotes/git-svn
 

 This was the config file.  There is no origin at all.
 


 [remote "origin"]
 url = https://github.com/TES5Edit/TES5Edit-Test.git
 fetch = +refs/heads/*:refs/remotes/origin/*
 

 Those lines are not there.
 

 Now those are the command lines.  The reason for my post is to show that if I don't know how to do this from the command line I can't do it With SmartGit because I don't know what order to do everything.  Once it's cloned everything is in the git-svn folder and I can't get those commits into master.  One a bigger project I want to take a commit and only use certain files for one branch and certain files for anothr branch and split the commit.
 

 I am hoping that SmartGit can provide me with a solution.  I'm just waiting to find out if it can and what steps do I need to do.
 

 When I am done I am going to want clone the SVN repo with SmartGit using basically these commands.
 

 git svn init http://skyrim-plugin-decoding-project.googlecode.com/svn/ --ignore-paths="BOSS\\s(French|Italian|Spanish)\\sTranslation|CK\\sWiki\\sFiles|GCDownload\\sDescriptions|MWEdit|NexusDescriptionPages|TES3Edit|TES5Edit\\sDocumentation|TES5Load|Templates|ThreadSeed|USEPWiki|UESPWiki|wiki"
 

 <<< any additional thins I am missing>>>

 

 git svn fetch --authors-file=../authors.txt
 git checkout git-svn
 git checkout -B master --force # because I had no commits nothing to loose
 git pull
 git push --force
 




Reply | Threaded
Open this post in threaded view
|

Re: SVN to Git migration

SmartGit mailing list
>  For example today I did some more reading and I thought I would make a test repo,
> and then import the 36 commits from the URL I provided.  I realize that using the
> root of the SVN would be better but I want to get it to work first before I try it
> on the whole thing.
>  
>
>  Here are the new steps I though might work.
>  
>
>  git svn init http://skyrim-plugin-decoding-project.googlecode.com/svn/UESPWiki/ 
>  git remote add origin https://github.com/TES5Edit/TES5Edit-Test.git
>  git svn fetch --authors-file=../authors.txt
>  git checkout git-svn
>  git checkout -b master
>  git pull
>  git push --force

Please do not use "git svn", you won't need it. Just follow Dee's advice and clone your root with SmartGit.

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


07/18/2014 06:40 - [hidden email] [smartgit] wrote:

> > Have you tried to, from the repositories menu in smartgit (best use newest version), invoke "clone" and > simply giving it the address to the root of your repo (the address that you use with your svn client as well)?
>  > Best to do root, and not any deeper folders.
>  
>
>  i was kind of discussing the complexities of my issue and asking if SmartGit cold
> help.  I see that in the program and I can set that.  However, where does that
> apply to my question so I can use that as one of the steps.  My problem is that
> the steps I use to create the Repo are clearly wrong.  I have had little luck
> finding the exact steps I need.
>  
>
>  For example today I did some more reading and I thought I would make a test repo,
> and then import the 36 commits from the URL I provided.  I realize that using the
> root of the SVN would be better but I want to get it to work first before I try it
> on the whole thing.
>  
>
>  Here are the new steps I though might work.
>  
>
>  git svn init http://skyrim-plugin-decoding-project.googlecode.com/svn/UESPWiki/ 
>  git remote add origin https://github.com/TES5Edit/TES5Edit-Test.git
>  git svn fetch --authors-file=../authors.txt
>  git checkout git-svn
>  git checkout -b master
>  git pull
>  git push --force
>  
>
>  That failed on step #2.
>  
>
>  [core]
>  repositoryformatversion = 0
>  filemode = false
>  bare = false
>  logallrefupdates = true
>  symlinks = false
>  ignorecase = true
>  hideDotFiles = dotGitOnly
>  [svn-remote "svn"]
>
>  url = http://skyrim-plugin-decoding-project.googlecode.com/svn/UESPWiki
>  fetch = :refs/remotes/git-svn
>  
>
>  This was the config file.  There is no origin at all.
>  
>
>
>  [remote "origin"]
>  url = https://github.com/TES5Edit/TES5Edit-Test.git
>  fetch = +refs/heads/*:refs/remotes/origin/*
>  
>
>  Those lines are not there.
>  
>
>  Now those are the command lines.  The reason for my post is to show that if I
> don't know how to do this from the command line I can't do it With SmartGit
> because I don't know what order to do everything.  Once it's cloned everything is
> in the git-svn folder and I can't get those commits into master.  One a bigger
> project I want to take a commit and only use certain files for one branch and
> certain files for anothr branch and split the commit.
>  
>
>  I am hoping that SmartGit can provide me with a solution.  I'm just waiting to
> find out if it can and what steps do I need to do.
>  
>
>  When I am done I am going to want clone the SVN repo with SmartGit using
> basically these commands.
>  
>
>  git svn init http://skyrim-plugin-decoding-project.googlecode.com/svn/
> --ignore-paths="BOSS\\s(French|Italian|Spanish)\\sTranslation|CK\\sWiki\\sFiles|GCDownload\\sDescriptions|MWEdit|NexusDescriptionPages|TES3Edit|TES5Edit\\sDocumentation|TES5Load|Templates|ThreadSeed|USEPWiki|UESPWiki|wiki"
>  
>
>  <<< any additional thins I am missing>>>
>
>  
>
>  git svn fetch --authors-file=../authors.txt
>  git checkout git-svn
>  git checkout -B master --force # because I had no commits nothing to loose
>  git pull
>  git push --force
>  
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: SVN to Git migration

SmartGit mailing list
Okay I did that but it it put the commits into git-svn.  I appreciate the answers so far but in my OP I ask if the software would provide me a solution to my challenges converting an SVN to Git.  

 I am not disparaging the software, in fact I am keeping an open mind and genuinely trying to use it.  However, I though it would be easier to ask if it can do what I want it to do.  I have not had an answer to that effect.  I had 4 things listed in the OP.

 Would a video be more helpful in expressing my concerns?  Since a picture is worth a thousand words, here is a 5 min video https://www.youtube.com/watch?v=MULfcX3g-_U of my concerns.  Also I have a longer video showing me stumbling along.  I know there is documentation and StackOverflow about git and I have looked at plenty of documentation.  It's how I have been able to clone anything from the command line at all.  I have been at this for weeks.  The thing is I was hoping for a GUI solution.  I hope SmartGit can do what I am looking for.

 

 To make it easier here are my four concerns again.
 The ability to specify a blame file or some kind of text file for the authors of the commits on the SVN so I don't need to use unix scripts in GitBash to blame the contributors.
 As I go through each commit from the SVN I need the ability to specify that 1 commit will go to master.  I also need to split commits when 4 of the files need to go to one branch and the other files go to another branch
 This is not critical, but it would just be nice if I could do this.The ability to specify which folders from the SVN go to which repository within the organization. The ability to make the changes without getting warnings and notifications that there was an issue so the operation can't be performed.  The actions I would use at the command line should be preformed by SmartGit transparent to me as if I were an Uber Git Pro. Will the software be able to provide me with a solution?  If it will do 1 and 2 but not 3 and 4 then at least inform me of what it can do.
 




Reply | Threaded
Open this post in threaded view
|

Re: SVN to Git migration

SmartGit mailing list
Here is me stumbling along http://youtu.be/RJvB4qEH9mk.  However i recently found that if I try "How to" an action and then "Syntevo" I am starting to see some documents.  I do really want to read the documentation.  However, to start with I really hope the GUI can help me eliminate the need to use the command line.  While I am waiting for more feedback I'll try to see what other documentation is out there.

 Thanks
Reply | Threaded
Open this post in threaded view
|

Re: SVN to Git migration

SmartGit mailing list
In reply to this post by SmartGit mailing list
>  The ability to specify a blame file or some kind of text file for the authors of
> the commits on the SVN so I don't need to use unix scripts in GitBash to blame the
> contributors.

Not sure, what you mean by "blame file", however if it's about a mapping of SVN authors to email addresses, have a look at:

http://smartgit.3668570.n2.nabble.com/Set-svn-authorsfile-when-pulling-form-svn-repository-td7574927.html

>  As I go through each commit from the SVN I need the ability to specify that 1
> commit will go to master.  I also need to split commits when 4 of the files need
> to go to one branch and the other files go to another branch

This can't be done per case, but only automatically according to the "branch mapping": if your SVN repository has /trunk, /branches and /tags directories (either as top-level directories or per project directory), SmartGit should offer you to "Map SVN trunk, tags and branches to Git" in the Clone wizard.

>  This is not critical, but it would just be nice if I could do this.The ability to
> specify which folders from the SVN go to which repository within the organization.

So you would map one SVN repository to multiple Git repositories? You can only do that manually, e.g. by just cloning

<repo-root-url>/project

instead of

<repo-root-url>

> The ability to make the changes without getting warnings and notifications that
> there was an issue so the operation can't be performed.

Please be more specific here: which exact actions did you take and which exact warnings did you get?

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com



07/19/2014 04:20 - [hidden email] [smartgit] wrote:

> Okay I did that but it it put the commits into git-svn.  I appreciate the answers
> so far but in my OP I ask if the software would provide me a solution to my
> challenges converting an SVN to Git.  
>
>  I am not disparaging the software, in fact I am keeping an open mind and
> genuinely trying to use it.  However, I though it would be easier to ask if it can
> do what I want it to do.  I have not had an answer to that effect.  I had 4 things
> listed in the OP.
>
>  Would a video be more helpful in expressing my concerns?  Since a picture is
> worth a thousand words, here is a 5 min video
> https://www.youtube.com/watch?v=MULfcX3g-_U of my concerns.  Also I have a longer
> video showing me stumbling along.  I know there is documentation and StackOverflow
> about git and I have looked at plenty of documentation.  It's how I have been able
> to clone anything from the command line at all.  I have been at this for weeks.
> The thing is I was hoping for a GUI solution.  I hope SmartGit can do what I am
> looking for.
>
>  
>
>  To make it easier here are my four concerns again.
>  The ability to specify a blame file or some kind of text file for the authors of
> the commits on the SVN so I don't need to use unix scripts in GitBash to blame the
> contributors.
>  As I go through each commit from the SVN I need the ability to specify that 1
> commit will go to master.  I also need to split commits when 4 of the files need
> to go to one branch and the other files go to another branch
>  This is not critical, but it would just be nice if I could do this.The ability to
> specify which folders from the SVN go to which repository within the organization.
> The ability to make the changes without getting warnings and notifications that
> there was an issue so the operation can't be performed.  The actions I would use
> at the command line should be preformed by SmartGit transparent to me as if I were
> an Uber Git Pro. Will the software be able to provide me with a solution?  If it
> will do 1 and 2 but not 3 and 4 then at least inform me of what it can do.
>  
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: SVN to Git migration

SmartGit mailing list
If It can't map SVN authors to the commits when it fetches from the SVN like "git svn fetch --authors-file=../authors.txt" does then I could still use a script for that.  However, if it can't help me go through each commit from the SVN and specify that 1 commit merges into master, or split a commit so that 4 of the files go to one branch and the other files go to another branch then SmartGit won't do what I am looking for.

 It's still a good program I liked what I saw and it seems to clone better then I do at the command line.  I like what it did for cloning the repo.
 

 Thanks for the response.
Reply | Threaded
Open this post in threaded view
|

Re: SVN to Git migration

SmartGit mailing list
> If It can't map SVN authors to the commits when it fetches from the SVN like "git
> svn fetch --authors-file=../authors.txt" does then I could still use a script for
> that.

You can, using "smartgit.svn.authorsfile" system property, as the posting explains.

> However, if it can't help me go through each commit from the SVN and
> specify that 1 commit merges into master, or split a commit so that 4 of the files
> go to one branch and the other files go to another branch then SmartGit won't do
> what I am looking for.

SmartGit will automatically put files committed to trunk into ref "trunk" and files committed to branch into ref "branch", regardless whether you have committed to multiple branches in the same revision or not.

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


07/19/2014 21:50 - [hidden email] [smartgit] wrote:

> If It can't map SVN authors to the commits when it fetches from the SVN like "git
> svn fetch --authors-file=../authors.txt" does then I could still use a script for
> that.  However, if it can't help me go through each commit from the SVN and
> specify that 1 commit merges into master, or split a commit so that 4 of the files
> go to one branch and the other files go to another branch then SmartGit won't do
> what I am looking for.
>
>  It's still a good program I liked what I saw and it seems to clone better then I
> do at the command line.  I like what it did for cloning the repo.
>  
>
>  Thanks for the response.
>