3

I've been trying to ignore particular files and directories in order to prevent local modifications being submitted to repository.

The problem I am having is that once a file has been committed to a repository, you cannot then ignore it.

svn propset svn:ignore '*' ./stuff

If the files in the ./stuff folder have already been added and committed, they are not ignored for future commits. I find I often want to ignore particular files at the beginning of a project but cannot as these directories are not working copies so i'm doing

svn add *
svn revert fileIWantToIgnore.ext
svn propset svn:ignore 'fileIWantToIgnore.ext' .

This is a bit of a laborious process. What would be your suggestions?

dianovich
  • 2,288
  • 21
  • 34
  • possible duplicate of [Protect files from svn commit.](http://stackoverflow.com/questions/2779293/protect-files-from-svn-commit) – Wim Coenen Jan 07 '11 at 21:34

2 Answers2

5

Delete the files you wanted to ignore but were committed. Commit the version with the files deleted. Restore the files to your source, and add the property svn:ignore now.

It's not clean but useful

David Canós
  • 1,806
  • 18
  • 19
0

That is what it is supposed to do, but you could try these.

Create a pre-commit hook script that reject the commit when a specific property is being added. You can then add this property to files in the working copy to prevent commits.

TortoiseSVN will exclude files in the special changelist "ignore-on-commit". However, this is not honored by the SVN command-line client.

SVN: Is there a way to mark a file as "do not commit"?

Community
  • 1
  • 1
ctrl-alt-delor
  • 7,506
  • 5
  • 40
  • 52