Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN- How to commit multiple files in a single shot

Tags:

file

commit

svn

I tried to commit multiple files across different directories in a single shot as below,

svn commit –m”log msg” mydir/dir1/file1.c mydir/dir2/myfile1.h mydir/dir3/myfile3.c etc etc 

Since, I wanted to exclude some files from the commit list so I’ve placed each file name in the command line as above. I put it together in the notepad and it came about 25 files. When I copy and paste it on the command line, the last few files are missing and I guess this might be a command line buffer limitation (?). Is there any option I can increase the buffer length?

Is there any option I can put all files in a text file and give it as an argument to svn commit?

like image 548
Thi Avatar asked Dec 02 '10 13:12

Thi


People also ask

How do I commit all files in svn?

svn add --force . will add all the files and directories below your current working directory that aren't added yet (and aren't ignored) to your working copy. A svn ci -m "" will then handle the commit. The only way without 'svn add' would be to use 'svn import', but this assumes a new location.

Can multiple files be added in svn?

Edit These files exist in a directory tree so adding * for one directory will not work. @your edit: So then provide multiple paths to add like: svn add dir1/* dir2/* dir3/* or as many have mentioned grep the ouput of svn stat from the root and pipe it to cut or awk and then to add.

How do I commit newly added files in svn?

right drag them to the new location inside the working copy. release the right mouse button. select Context Menu → SVN Add files to this WC. The files will then be copied to the working copy and added to version control.


1 Answers

You can use an svn changelist to keep track of a set of files that you want to commit together.

The linked page goes into lots of details, but here's an executive summary example:

$ svn changelist my-changelist mydir/dir1/file1.c mydir/dir2/myfile1.h $ svn changelist my-changelist mydir/dir3/myfile3.c etc. ... (add all the files you want to commit together at your own rate) $ svn commit -m"log msg" --changelist my-changelist 
like image 115
Mark Pim Avatar answered Sep 23 '22 05:09

Mark Pim