Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Commit modified files only using subversion

I have a long list of commits to make and, as such, would like to stagger the commits. So, when I do:

svn st | ack '^M'

I would like to commit these files only

Is this possible through the command line?

like image 759
crmpicco Avatar asked Jun 27 '26 00:06

crmpicco


1 Answers

The xargs command is useful for this kind of thing.

Assuming you don't have any filenames containing space characters, you can do:

svn st | sed -n 's/^M//p' | xargs svn commit

If you do have space characters in filenames, the sed command becomes a little more complex, to add quotes around each filename:

svn st | sed -n 's/$/"/; s/^M */"/p' | xargs svn commit

(I'm not familiar with ack -- perhaps it could be also be used in place of sed in these examples)

like image 59
slowdog Avatar answered Jun 29 '26 21:06

slowdog



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!