Commit modified files only using subversion

戏子无情 提交于 2019-12-12 20:35:03

问题


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?


回答1:


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)



来源:https://stackoverflow.com/questions/10213308/commit-modified-files-only-using-subversion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!