Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN:ignore how-to and on what?

It seems to me that adding the property svn:ignore on files like .classpath would be a good idea. I use both Windows (work, ugh) and Linux development environments and every time I sync with the repository it overwrites my .classpath from whichever machine I'm working on.

I tried right-clicking the .classpath file in the Team Sync perspective, but the svn:ignore option is greyed out.

Any ideas how I might: 1. get this item out of source control, 2. add it to an ignore list?

Any other files a smart addition to this list?

like image 562
Bill Mote Avatar asked Mar 17 '11 19:03

Bill Mote


People also ask

How do I ignore in svn?

The svn:ignore property You give svn:ignore a value, which is a file name pattern. Then, svn will ignore all items in this directory whose name matches the pattern. For example: svn propset svn:ignore *.

Where is svn ignore list?

If you are using TortoiseSVN, right-click on a file and then select TortoiseSVN / Add to ignore list. This will add the file/wildcard to the svn:ignore property. You can find this list in the context menu at TortoiseSVN / Properties.

How do I ignore bin and obj folder in svn?

The text box “Global ignore pattern” defines what patterns you want to exclude; in my case I wanted to remove bin and obj folders, and ReSharper related files, which typically contain _ReSharper, so I added bin obj _ReSharper to the list of patterns. Et voila!

How do I ignore a class file in svn?

Another way to ignore files is to add them to the global ignore list. The big difference here is that the global ignore list is a client property. It applies to all Subversion projects, but on the client PC only.


2 Answers

At the command line:

svn rm --keep-local .classpath
svn pe svn:ignore .

The first command removes .classpath from SVN while keeping the file locally. The second command lets you edit svn:ignore. Add ".classpath" to the property.

The general rule is that any build output, machine-specific, or user-specific files should not be versioned and then be added to svn:ignore. I'm not familiar with Java or Eclipse specifically so I couldn't mention any files by name.

like image 101
Mike Avatar answered Sep 22 '22 03:09

Mike


To get svn:ignore, remember that svn:ignore is a property of a file system entry. That means you need to use svn propedit svn:ignore (to edit the property).

What should you ignore? Anything that's built from something else. All "lock files" that editors might put in place. All temporary files. Some configuration files that require differences between developer (however, you should check in a template with a slightly modified name, like config.template). Basically, anything that you don't want checked in.

It sounds like you are using a non-command line client. Maybe the client is configured to not allow you to modify this file (or it's properties). Maybe it's a different issue. I would recommend installing a command line client, as the errors will be more verbose (and not subject to interpretation like your "grey" color is).

Odds are good you will have to svn:delete the file first (make a copy of it or you'll lose your only copy), and commit the "deletion" back to the repository. Then propedit the directory where the .classpath file was to add ".classpath" to the svn:ignore list.

like image 24
Edwin Buck Avatar answered Sep 22 '22 03:09

Edwin Buck