SVN status with ignore

Posted under » Version Control on 16 July 2019

SVN status is usefull but sometimes it can get clutterred. Delete what you don't want to see.

It's quite convenient to SVN ADD use wildcards (*) but There are times you regret adding a folder. To cancel an "svn add example_folder" command before committing to the repository, do not use svn delete or svn remove or made-up stuff like undo or cancel. Use the svn revert command:

$ svn revert --recursive example_folder

If you already committed but you want to ignore it, then delete it with a --keep-local option.

$ svn delete --keep-local example_folder

Read more about deleting multiple files.

Try some of this.

$ svn status -u
$ svn status -q
$ svn status -u | grep M

Ignore some directories and files. How this works is that you use the command svn propset to set the property svn:ignore. You give svn:ignore a value, which is a file name pattern. Then, svn will ignore all items in this directory (logs) whose name matches the pattern.

$ svn status logs  
?       logs/learnerapp.log
$ svn propget svn:ignore logs
svn: warning: W200017: Property 'svn:ignore' not found on 'logs'

svn: warning: W200017: Property 'svn:ignore' not found on 'logs' simply indicates that the svn:ignore property has not been set on the specified directory named "logs". It is a harmless warning and not an error that will stop operations.

$ svn propset svn:ignore "*.log" logs
$ svn up
$ svn status
 M      .
 M      logs
$ svn commit -m 'ignore logs'
$ svn status

You will see that the status log is empty. logs/learnerapp.log does not appear anymore.

If you want svn status to tell you about the ignored files as well, you can do:

$ svn status --no-ignore
More ignore info.

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS data