Subversion commit and ignored files



Just a quick note for provide a solution to a problem that, sometimes, can happen during a subversion commit operation. Subversion, frequently abbreviated as SVN, is a software versioning and revision control system distributed under an open source license. I will not explain here how to use subversion since if you know them you surely already know how to use it. On the contrary, if you don't know it probably you don't need them. Anyway if you make a commit operation of a large number of files containing also binary file like precompiled libraries and so on keep attention since is possible (especially under Linux) that some type of file are automatically included in a special list of ignored files. This mean these files ignored by subversion will not be added to the commit without give you any advise of that.
To be more precise these files are ignored during the "add" phase when the files are initially signed by subversion to be committed. As a good habit for check if some files was ignored is always better to launch this command after an add operation:

svn status . --no-ignore | grep "^I"

The flag --no-ignore force subversion to show also ignored files (ignored file are marked with the letter "I" instead of "A") and the grep command show only them. Once verified some files was ignored you need to launch an "extended" version of the past command to force the addition of these files as follow:

svn add `svn status . --no-ignore | grep "^I" | awk '{print $2}'`

Basically this simple command get the list of ignored files and pass them to the add command. Now you can launch the commit command and be sure that all your files will be archived.

By the way another useful command is the following:

find . -type d -name .svn -exec rm -rf {} \;

If you launch this command inside a "subversioned" folder will clean all the ".svn" hidden folders and you have the same result as you use the svn export operation. This command can be very useful if you want to commit a folder that is always under subversion (contain the .svn folders) but refer to a different repository. Hope that this help....


0 Comments:

Post a Comment