Reputation: 35796
Is there a simple command to add a directory and all files underneath it to svn
?
I have tried svn add directory
which makes sense to me but this doesn’t work as expected. I have googled it and there are solutions which all appear a bit long-winded for something so simple.
What would be the standard way of doing this?
Upvotes: 1
Views: 2899
Reputation: 10360
svn add folder
will add the folder and its contents. How doesn't it work as you expect?
Upvotes: 0
Reputation: 11173
svn add directory
only works if the directory hasn't been added already. Adding all new files is not standard operation in svn world. Git does this but that's sidetracking.
You can often get by with svn add directory/*
but it misses new files in existing subdirectory. So:
If you really need to add any file anywhere in the directory hierarchy this one liner will set-up an alias for you to do this:
alias svn_addall="svn st|grep ^?|sed 's/./svn add/'|sh"
Put it into your .profile and you'll have easy access to it any time. :-)
Upvotes: 2
Reputation: 1151
Funny. Which version of svn are you using. I`m on a mac and use svn 1.6. And it works for me. When i look at my man pages for svn then it looks like the command is recursive by default. You can permit the behaviour with:
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
Upvotes: 0