Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do svn ignore on a single file?

Tags:

svn

I know it's a basic question but I've tried every combination of propedit propset, etc.

In an existing project, there's a file (let's call it 'error.log) I want to ignore for all future commits. What's the command-line syntax to do so?

like image 529
Zando Avatar asked Apr 28 '10 22:04

Zando


2 Answers

Go to the directory of the error-log file and type

svn propedit svn:ignore .

An editor will open and you need to add a line with the file name error.log. Save and exit the editor. Commit the changes.

like image 160
Arne Burmeister Avatar answered Oct 21 '22 10:10

Arne Burmeister


First you must ensure the file is not already in your repository.

If it is, you need to delete it from the repository and commit that change before you move on.

Then it is as simple as adding the property:

svn propset svn:ignore . "..."

If you've already ignored other files, you must set the property to contain the old list + error.log, otherwise you can just do:

svn propset svn:ignore . "error.log"

Then you commit that so that other working copies will get the same property and you should be all set.

Also, if you're on Windows, and using [TortoiseSVN][1], it's as simple as doing this:

  1. Right-click the folder and select Commit
  2. In the list, the error.log file should be listed without a checkmark
  3. Right-click the file, select Ignore, and add it as a single item (not *.log) to the ignore list
  4. Commit

Note again, you must ensure the file is not in your repository when you do this, so if it is, delete it before you add the ignore setting.

like image 38
Lasse V. Karlsen Avatar answered Oct 21 '22 10:10

Lasse V. Karlsen