How to SVN Commit all files, except one, using command-line only?

Go To StackoverFlow.com

3

In my project, there are 25 modified files. I need to commit 24 of those files to the SVN Repository. The one single file that I do not want to commit is not complete yet, so I will commit it at a later date.

I'm using a remote shell on a Linux Server to do SVN commits. The only way I know how to do the above is to type:

# svn ci file1 file2 file3 file4........... file24

It's kind of ridiculous and inefficient. Is there an easier alternative to this? Can I commit everything but choose to leave out certain files?

Is some fancy bash script needed for this?

2012-04-05 16:04
by Jake Wilson
hm, the only idea that i have is. Temporarily ignore the file you don't want to commit, commit everything else, and remove the ignore afterwards. But i think ignore doesn't work that way, if the file is already in the repository .. - dowhilefor 2012-04-05 16:12
I thought about that as well but it seems like it's a silly way to do it - Jake Wilson 2012-04-05 16:23


2

If you need it in a single transaction try something like this:

svn commit `svn status | sed -n -e '/file_you_dont_want/!s/^.......//p'`
2012-04-05 16:22
by Bartosz Moczulski
The inability to do simple things like this reminds me why so many folks are migrating away from Subversio - Lambart 2014-07-02 22:28


0

Yes. You could write a bash script that commits all the files in a certain directory, except those that you pass it as an argument. The core of the script is a loop:

for x in `ls`
do
     svn ci $x
done

You can either choose to put together a filter by piping the output of ls through grep, or put an if statement inside the loop. I'd probably go for the first.

2012-04-05 16:11
by FrankieTheKneeMan


0

You can use changelist:

svn cl _listName_ -R *
svn --remove unexpected_filenames
svn commit --cl _listName_
2015-05-04 12:06
by mk761203
Ads