Skip to content

Instantly share code, notes, and snippets.

@hgupta
Created December 3, 2012 09:55
Show Gist options
  • Save hgupta/4193973 to your computer and use it in GitHub Desktop.
Save hgupta/4193973 to your computer and use it in GitHub Desktop.
Adding multiple files to SVN using CLI
# Method 1
svn st | grep "^?" | awk '{ print $2}' | while read f; do svn add "$f"; done
# Method 2
svn st | grep "^?" | cut -b 8-1000 | xargs svn add
# Method 3
svn add * –force
# Method 4
svn add $(svn status | grep "^?" | awk '{print $2}')
# Method 5
#! /bin/sh
echo "Add the following files to the repository?"
for file in `svn status | grep "^?" | awk '{ print $2}' `
do
echo -n "$file ? "
read decision
case "$decision" in
y | Y | yes | YES | Yes ) svn add $file;;
* )
esac
done
exit 0
# URL Reference: http://www.arraystudio.com/as-workshop/how-to-add-multiple-files-to-subversion.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment