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?

4

2 回答 2

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

于 2012-06-29T21:06:41.617 回答
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"?

于 2011-01-07T17:31:29.197 回答