Accept working copy “as is” in Subversion
Is there a simple way to accept the working copy “as is” in Subversion? I would开发者_如何学运维 like to have the “unknown” files denoted by ?
to be added, missing files to be deleted and changed files commited.
a svn commit
would commit the modified files, but for:
- the deleted files, you need first (before the commit) a command like
$ svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm %
- the files added (with spaces in them):
$ svn status | grep "^\?" | sed -e 's/? *//' | sed -e 's/ /\\ /g' | xargs svn add
On recent SVN you could just svn add --force *
(it is recursive)
There isn't a single svn command that does all that at once.
Here is a simple bash script that deletes missing files:
for i in `svn list -R`; do if [ ! -e $i ]; then svn rm $i; fi; done
If your on windows use TortiseSVN it will show you a list of all the new/deleted files and you can just select all the changes and commit.
精彩评论