Reputation: 2287
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?
Upvotes: 3
Views: 4502
Reputation: 1994
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
Upvotes: 5
Reputation: 7745
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"?
Upvotes: 0