Elist
Elist

Reputation: 5533

SVN - lock local changes for check in

I am working with eclipse subversion plugin, and made some local changes to crucial files, which I don't wan't to check in. I'm looking for a way to "lock" (I know that the lock term means something else in svn...) these local files and disable checking them in, so that I won't accidentally check them in.

Upvotes: 0

Views: 274

Answers (2)

Ben Reser
Ben Reser

Reputation: 5765

The answer largely depends on if the file is already being tracked (versioned) by Subversion or not.

Not Versioned

Setting up an ignore via one of the several methods we have of ignoring files will do what you want. If you're using 1.8 we also have svn:global-ignores which supports inheritance (so if you want to say ignore all files with the .o extension you could just set a svn:global-ignores with *.o as a pattern.)

Versioned

If the file is already in the repository and is versioned then ignore won't help you since versioned files are not ignored by any configuration you do. One alternative, as mentioned in the answer to this question "How do I avoid checking in local changes to the SVN repository?", is to use a changelist and add the file to the changelist.

A better option might be to restructure your setup to not require making local changes to versioned files. A common pattern you will see is configuration files where the committed file is a template, developers then copy the template into another name that is used and customize it.

Upvotes: 1

Chris Maes
Chris Maes

Reputation: 37832

Maybe you can just ignore them:

Team --> add to svn:ignore

if necessary you can do this via the svn command line. This way you might add a pattern to svn ignore

svn pe svn:ignore .

then you can fill in something like:

*.d

NOTE that svn:ignore is different for each subfolder (hence the "." in the svn command)

Upvotes: 1

Related Questions