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?
If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a . gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.
A local . gitignore file is usually placed in the root directory of a project. You can also create a global . gitignore file and any entries in that file will be ignored in all of your Git repositories.
gitignore should list the names or name-patterns of files that will be found in work-trees when working with your project, but that should not be committed to the project. In other words, it's not OS-specific, it's project-specific.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With