這裏有一個的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