Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration of svn-ignore to .gitignore #14

Open
phaidros7 opened this issue May 16, 2011 · 9 comments
Open

migration of svn-ignore to .gitignore #14

phaidros7 opened this issue May 16, 2011 · 9 comments

Comments

@phaidros7
Copy link

would be nice to have, else I always do this after svn2git:

svn propget svn:ignore -R svn://host/repo > .gitignore
git add .gitignore
git commit -m 'Convert svn:ignore properties to .gitignore.'

@JakeWharton
Copy link

svn:ignore can be set on any directory within the repository hierarchy. You would have to recursively traverse all folders and add lines prefixed with the current directory for each property found.

@phaidros7
Copy link
Author

imho "propget svn:ignore -R" gets all the ignores recursively. of course in a useless format, but after altering it suitable for git, it seems to work.

@toastkid
Copy link

@phaidros7 - top tip! I used it like this:

svn propget svn:ignore -R > .gitignore
then in the new .gitignore file, replace " - " with "/". Might have to do a little bit of tidying.
then copy .gitignore to your git folder.

@nirvdrum
Copy link
Owner

Seems like a nice thing to add. Pull requests are welcome if you've already done the work.

@luisfaceira
Copy link

This would be nice indeed.

However, I'm not sure I like this approach. Setting every ignore in a central file is a simple solution but by doing it with isolated .gitignore files in each directory it would also solve a different related issue: empty directories are not imported into git (they are oddly not supported in git).

For logging and caching logs in our frameworks, we have "svn:ignore *" and that keeps those directories empty, which then are not imported into git. But if we use ".gitignore *" in each folder, they would be imported since they won't be empty anymore.

I've created a simple oneliner that helps me achieve what I was talking about.
There are some issues so all the help is appreciated: https://gist.github.com/1213601

@aik099
Copy link

aik099 commented Jun 26, 2013

After 2 years this is still an issue. Any plans on fixing.

Without this I got every empty folder with "svn:ignore" property set to it removed in each tag/branch of imported repository.

@aik099
Copy link

aik099 commented Jun 26, 2013

It seems, that git svn create-ignore option with following description:
Recursively finds the svn:ignore property on directories and creates matching .gitignore files. The resulting files are staged to be committed, but are not committed. Use -r/--revision to refer to a specific revision.

Also git svn mkdirs would create empty directories, that were deleted during import. Maybe it's good idea to place empty .gitignore file in them to prevent their deletion.

@aik099
Copy link

aik099 commented Jun 26, 2013

Right now I don't see other way, rather then for each branch/tag produced by "git svn" command do a single commit with all .gitignore files. Then convert branch-tags into real tag, that svn2git already does.

@jamesford42
Copy link

Um, this seem to me like an super easy solution... simply make a .gitignore inside each folder, populated with its svn ignore properties. There doesn't need to be some complicated aggregation of everything into a root level .gitignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants