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.
views:
43answers:
3
+2
A:
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)
VonC
2010-03-04 14:14:48
+1
A:
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
amarillion
2010-03-04 14:15:13
+1
A:
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.
HaxElit
2010-03-04 14:21:22
Thank you for the tip, but I need to script that.
zoul
2010-03-04 14:34:27