Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Oneliner to convert svn:ignore into .gitignore
cat .gitignore | sed 's/^/\.\//g;s/\(.*\)\/\([0-9a-zA-Z\*\?\.]*\)$/svn propedit svn:ignore "\2" \1 /mg' | bash
svn propget -R svn:ignore | grep -v "^$" | sed "s/\(\(.*\) - \)\(.*\)/\2\/\3/g" | sort -u >> .gitignore

This comment has been minimized.

Copy link

sanjay-russmediatech commented Jul 27, 2017

really helpful


This comment has been minimized.

Copy link

svendhhh commented Aug 11, 2017

Can I suggest adding a -u to the sort of to remove duplicates?
(I'm not sure why there'd be duplicates in the SVN ignore, or if could make sense there, but I'm pretty sure it doesn't make sense in .gitignore)?
I found out why I had duplicates. I had the "root" of the SVN project checked out, so was getting some entries for all branches/tags as well as root, and some duplicates that way... might not be any use to add the -u after all?


This comment has been minimized.

Copy link
Owner Author

iegik commented Jun 22, 2018

@svendhhh Sure. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.