这里有一个的Windows PowerShell版本只承诺不在一个变更的文件。创建一个名为ignore-on-commit的更改列表(Tortoise SVN会理解),并将不想提交的文件放入其中。
# get list of changed files into targets
[XML]$svnStatus = svn st -q --xml C:\SourceCode\Monad
# select the nodes that aren't in a changelist
$fileList = $svnStatus.SelectNodes('/status/target/entry[wc-status/@item != "unversioned"]') | Foreach-Object {$_.path};
# create a temp file of targets
$fileListPath = [IO.Path]::GetTempFileName();
$fileList | out-file $fileListPath -Encoding ASCII
# do the commit
svn commit --targets $fileListPath -m "Publish $version" --keep-changelists
# remove the temp file
Remove-Item $filelistPath
谢谢你的回答 –
好吧,如果我有100个文件我想提交,只想排除一个。有没有办法? – hacklikecrack
只需使用shell,就像让SVN列出所有修改过的文件和grep -v单一一样。 – zoul