List all files needed to be commited into Subversion, then grep only files not added, this being lines starting with question mark. The ‘^\?’ means

  • ^ = line start
  • \ = escape next charater
  • ? = The character to search for, since ? is a metacharater in Regex, it must be escaped.

Then using awk print the file path and name and at last using xargs and svn add – add the files to svn.

svn status | grep ^\? | awk '{print $2}' | xargs svn add