How can SVN commit all files except one using command line only?

There are 25 modified files in my project. I need to upload 24 of these files to the SVN repository. The only file I don't want to commit is not complete yet, so I'll do that later.

I am using a remote shell on a Linux server to perform SVN commits. The only way I know how to do this is by typing:

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

      

This is ridiculous and ineffective. Is there an easier alternative to this? Can I transfer everything, but not leave certain files?

Does this require some fantastic bash script?

+3


source to share


3 answers


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'`

      

+2


source


Yes. You can write a bash script that commits all files in a specific directory except the ones you pass as an argument. The core of the script is a loop:

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

      



You can either choose the layout of the filter by running the ls output through grep, or put an if statement inside the loop. I would probably go first.

0


source


You can use the changelog:

svn cl _listName_ -R *
svn --remove unexpected_filenames
svn commit --cl _listName_
0


source







All Articles