I am using cvs2svn-2.4.0 for CVS to Git migration. This does not include the .cvsignore to .gitignore conversion. How do I convert .cvsignore files to .gitignore file?
Is there any provision for converting .cvsignore files to .gitignore file?
2.7k Views Asked by user2164525 AtThere are 5 best solutions below
On
Here's a Bash script which will look at the .cvsignore files in the directory tree and add their patterns to the top-level .gitignore file. It expects that the .cvsignore files contain only one pattern per line (apparently .cvsignore files allow multiple patterns in one line):
for f in `find . -name .cvsignore | sort `; do
dir=`dirname $f | sed -r 's:^\.::'`
cat $f | awk '{print "'$dir'/"$1}' >> .gitignore
done
In addition you have to add the default CVS ignore patterns from http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_18.html#SEC191.
On
Just use the command below in your terminal console:
find . -name .cvsignore -prune -exec mv {} .gitignore \;
On
you might have a look at a small python script I've written to convert cvsignore,v RCSFiles. So the commit history is not modified and no additional commits are created. It has it's limitations but done the Job well at our company. I placed it at github:
On
The find command should do a straight rename, and although the formats are somewhat the same there are some subtle differences, which you'll want to change later
By and large this was a good start when moving from CVS to GIT at least to begin with. I had hundreds of these .cvsignore files, and I performed this action after the cvs2git conversion
find . -name '*.cvsignore' -print -exec rename ".cvsignore" ".gitignore" {} \;
Don't forget that CVS has an global ignore file in the CVSROOT module, so you may miss some of them that you had in CVS by just converting the local .cvsignore
You can get to those global one by doing
cvs checkout CVSROOT where you will find, those in the "cvsignore" file
checkoutlist config cvsignore editinfo modules rcsinfo verifymsg
commitinfo CVS cvswrappers loginfo notify taginfo
I then recommend putting those global ones into the root folders .gitignore
Note: there are different versions of rename (kernel,perl) the command wouold fail if rename is the perl based regular expression version, ensure you are using the correct rename
You can't just copy
.cvsignoreto.gitignore- the formats aren't identical (unless it's a simple list of files in the top directory.E.g., take a look at Eclipse's guide for migrating to Git: