Domanda

We are trying to add to .cvsignore a previously and accidentally committed target directory (containing binary files).

It just does not work. Each time we synchronize with repository or commit (using Eclipse), the target directory is included...

We are not sure how to proceed. Can anyone please provide advice?

È stato utile?

Soluzione

Once a file or directory has been committed to the repository, .cvsignore will not work. I'm pretty sure this is a limitation of CVS, but I can't find a reference. The only way I know to proceed is to manually remove the files from the repository (as in, go to the server file system and delete them).

Altri suggerimenti

To avoid messing with the repository directly, I

  • mv myFileToIgnore myFileToIgnore.save
  • cvs remove myFileToIgnore
  • cvs commit myFileToIgnore
  • mv myfile.save myFileToIgnore

This moves the file out of the way so that I can remove it from the repository the cvs friendly way then puts it back where I need it to be.

If I have a bunch of files to do this to (ex: *.counter) I would save them in a directory so I can use wildcards to save and restore them.

HTH

This is a few years late, but if you have access to the CVS command line binaries, you could remove the target directory recursively using this command:

cvs remove -fR target

Once the files have been removed, check in the changes:

cvs ci -m "removing target dir" .

Finally, update the .cvsignore file to ignore the target directory.

And yes, I'm still forced to use CVS in 2015 and I have to deal with these issues. Hoping this answer helps folks in similar situations.

If you don't have access to the CVS server (you are therefore not able to delete the files on your own), you can follow the following steps to remove the files from the repo:

  • revert ".cvsignore" to its initial state (it did not contain "target", in your case)
  • move the "target" directory somewhere else (or remove it if you don't need it or can generate it afterwards)
  • commit the deletion, do not commit the altered .cvsignore
  • revert ".cvsignore" to the correct state (add "target", in your case)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top