tags:

views:

65

answers:

3

I am currently working on a checked out SVN project along with some plugins for that project. I want to keep all of this work - including the current version of my SVN checkout within a single git repository.

I thought I had achieved this by checking in the SVN working copy to git. However, when I did a pull on a new computer the SVN working copy had been corrupted. In particular it seemed that git had not checked it any of the .svn/tmp/ and .svn/props/ folders.

I have now made a fresh checkout of the SVN project. Is there a way for me to add the ignored folders to my git repo (git status ignores them even though my .gitignore is empty) or force SVN to regenerate them?

+2  A: 

File extensions that start with a period are considered hidden files by convention. So, I'm not Git expert, but I'm guessing Git ignores such files by default.

May I ask what you hope to achieve by keeping svn meta data in Git?

Assaf Lavie
I want to use git to manage my work on a patch to an open source project which uses svn. My approach (when I've got it working) will allow me to make multiple git revisions to my patch and still use tortoisesvn to easily generate a patch file. This all relies on the metadata being saved so that the normal svn tools still work.
mchr
But if git doesn't monitor/change the .svn directories then they are preserved and when you're done you can use them to generate the patch. btw, it would also be trivial to generate the patch just by overwriting a fresh checkout. If you rename or move files it's not like this information is going to be transferred from Git to SVN, so being able to save the .svn files isn't much more helpful than just having another pristine checked out copy at your disposal.
Assaf Lavie
These are all sensible suggestions. However I would prefer to be able to quickly git pull my repo including the svn working copy and have it all "just work". It sounds like that isn't possible so tomorrow morning I will write a quick script to regenerate missing tmp and props directories.
mchr
+1  A: 

Don't forget that if some of those .svn/tmp/ and .svn/props/ directories are empty, they won't simply be added to a git repository.
This is by design and has nothing to do with .gitignore.

VonC
I forgot about the empty directory restriction. Presumably I could fix this by writing a script to regenerate any of these missing directories.
mchr
@Vonc: Your rep has been recalculated as requested.
Bill the Lizard
@Bill: Thank you for the rep recalc :)
VonC
A: 

Why not use git svn clone:

http://ftp.kernel.org/pub/software/scm/git/docs/git-svn.html

This will import your entire SVN history into a git repository.

Mike Weller
I wasn't aware of git-svn. It looks like it could achieve what I want but feels less intuitive. Can you recommend a good tutorial for getting started with git-svn?
mchr