SVN- How to commit multiple files in a single shot

SvnFileCommit

Svn Problem Overview


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?

Svn Solutions


Solution 1 - Svn

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

Solution 2 - Svn

You can use --targets ARG option where ARG is the name of textfile containing the targets for commit.

svn ci --targets myfiles.txt -m "another commit"

Solution 3 - Svn

I've had no issues committing a few files like this:

svn commit fileDir1/ fileDir2/ -m "updated!"

Solution 4 - Svn

Use a changeset. You can add as many files as you like to the changeset, all at once, or over several commands; and then commit them all in one go.

Solution 5 - Svn

Same as the answer by Dmitry Yudakov, but without an intermediate file, using process substitution:

svn commit --targets <(echo "MyFile1.txt\nMyFile2.txt\n")

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionThiView Question on Stackoverflow
Solution 1 - SvnMark PimView Answer on Stackoverflow
Solution 2 - SvnDmitry YudakovView Answer on Stackoverflow
Solution 3 - SvnpsyView Answer on Stackoverflow
Solution 4 - SvnColin FineView Answer on Stackoverflow
Solution 5 - SvnAdrian B.View Answer on Stackoverflow