|
|
Quick Tips: Ignoring Fields in Subversion
Elmo Recio
Tuesday November 01, 2011 01:00 AM
|
|
In this quick tip, Elmo shows how to ignore unwanted fields with your friendly neighborhood subversion CVS.
|
|
To
ignore files or directories in Subversion, you edit your "~/.subversion/config"
file's "global-ignore" property, or you set the svn:ignore property on a
directory.
Editing your config file only applies to your personal working copy of the tree.
It's a space separated list of file patterns (globs). To test your settings you
can just use the "ls" command with whatever pattern you want.
I.e.:
global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej
*~ #*# .#*
.*.swp .DS_Store
Or if you set the svn:ignore property on the directory it will apply to anyone
who checks out a working copy as well. It's a newline separated list of file
patterns (globs). The process is simple, see if the property is already set in
that directory with proplist or pl (because you'll want to merge what's there
with your changes). If it's already set, get the property with propget or pg.
Set the new property with propset or ps. Commit your changes.
$ svn pl /my/working/copy
Properties on '/my/working/copy':
svn:ignore
$ svn pg svn:ignore /my/working/copy
tmp
$ svn ps svn:ignore 'tmp
> cache
> *.temp' /my/working/copy
property 'svn:ignore' set on '/my/working/copy'
$ svn pg svn:ignore /my/working/copy
tmp
cache
*.temp
$ svn commit -m ""
Note that instead of creating a file and using
svn ps svn:ignore -F
myIgnoreList.txt /my/working/copy
I used the single quote and just pressed enter until my list was complete. On
the last element of the list I entered a quote and finished my statement. It is
a shortcut if you do not want to create a file with your ignore list.
|
|
|