# Migrating plugins from svn to git

**URL:** <https://www.ruby-forum.com/t/migrating-plugins-from-svn-to-git/139000>\
**Category:** Rails\
**Created:** [May 29, 2008, 9:20pm UTC](https://www.ruby-forum.com/t/migrating-plugins-from-svn-to-git/139000 "2008-05-29T21:20:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sp00nyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Post date:** [May 29, 2008, 9:20pm UTC](https://www.ruby-forum.com/t/migrating-plugins-from-svn-to-git/139000/1 "2008-05-29T21:20:54Z")

</div>

Until recently, I was a using svn and piston to manage my dozens of  
plugins over a few projects. Now, I’m on the git train (literally,  
since I switched to have access to my repository on the train).  
Unfortunately, when I migrated my projects over to git I lost all my  
piston tracking of plugins. Is there a best practice for migrating  
existing plugins over to submodules, piston, or braid? Note, many of  
my plugins have local edits to either add or fix functionality, so I  
don’t want to simply blow them away.

I just spent the last hour or so looking around, but everything I  
found starts from scratch. I have a large project(s) with dozens of  
plugins each.

---

<div class="post-metadata">

**Author:** ![sp00nyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Post date:** [May 30, 2008, 12:01am UTC](https://www.ruby-forum.com/t/migrating-plugins-from-svn-to-git/139000/2 "2008-05-30T00:01:02Z")

</div>

gobigdave wrote:

I would first look to see if the plugin has been converted to git  
already. Try searching on github or gitorious.

If not, then go ahead and do a git-svn import, then create a  
git-submodule in your rails app. Works the best for me!

---

<div class="post-metadata">

**Author:** ![sp00nyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Post date:** [July 4, 2008, 8:45am UTC](https://www.ruby-forum.com/t/migrating-plugins-from-svn-to-git/139000/3 "2008-07-04T08:45:40Z")

</div>

Sam Granieri wrote:

> gobigdave wrote:
> 
> I would first look to see if the plugin has been converted to git  
> already. Try searching on github or gitorious.
> 
> If not, then go ahead and do a git-svn import, then create a  
> git-submodule in your rails app. Works the best for me!

I am also trying to get my footing using git, and from what I’ve read,  
it is preferable to use git submodule to add plugins to your projects  
than just simply cloning them in. Is this what you’ve found, and why?

Personally, I was content just cloning those bad boys in, but then I  
started noticing some very odd behavior. For example, let’s say I had  
already cloned in a few plugins. Then, let’s say I add another one, and  
instead of doing git add /path/to/plugin, I just do a “git add .” When I  
do that, git wants to delete some of my existing plugins, though I  
haven’t yet figured out in what order or pattern it tries to delete my  
existing plugins.

Also, I am curious to know how submodules work out in a deployment  
environment, and pushing to a remote repository. To my knowledge, when  
you’re tracking other repos with submodules, it doesn’t automatically  
add the submodule to your repository. I believe you have to do a  
submodule init or something. Can anyone speak to this? Thanks.
