{"id":4373,"date":"2011-10-28T04:31:00","date_gmt":"2011-10-28T04:31:00","guid":{"rendered":""},"modified":"2026-04-18T22:49:59","modified_gmt":"2026-04-18T22:49:59","slug":"one-liner-adding-files-to-svn","status":"publish","type":"post","link":"https:\/\/hellem.org\/wblog\/?p=4373","title":{"rendered":"One liner: Adding files to svn"},"content":{"rendered":"<p>List all files needed to be commited into <a href=\"http:\/\/subversion.apache.org\/\">Subversion<\/a>, then <a href=\"http:\/\/linux.about.com\/od\/commands\/l\/blcmdl1_grep.htm\">grep<\/a> only files not added, this being lines starting with question mark. The &#8216;^\\?&#8217; means<\/p>\n<ul>\n<li>^ = line start<\/li>\n<li>\\ = escape next charater<\/li>\n<li>? = The character to search for, since ? is a <a href=\"http:\/\/www.unix-manuals.com\/refs\/regex\/regex.htm\">metacharater<\/a> in Regex, it must be escaped.<\/li>\n<\/ul>\n<p>Then using <a href=\"http:\/\/www.linuxjournal.com\/article\/8913\">awk<\/a> print the file path and name and at last using <a href=\"http:\/\/linux.about.com\/library\/cmd\/blcmdl1_xargs.htm\">xargs<\/a> and <a href=\"http:\/\/svnbook.red-bean.com\/en\/1.0\/re01.html\">svn add<\/a> &#8211; add the files to svn.<\/p>\n<p><!-- codeblock lang=\"\" line=\"1\" --><\/p>\n<pre><code>svn status | grep ^\\? | awk '{print $2}' | xargs svn add<\/code><\/pre>\n<p><!-- \/codeblock --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>List all files needed to be commited into Subversion, then grep only files not added, this being lines starting with question mark. The &#8216;^\\?&#8217; means ^ = line start \\ = escape next charater ? = The character to search for, since ? is a metacharater in Regex, it must be escaped. Then using awk [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-4373","post","type-post","status-publish","format-standard","hentry","category-work-geek"],"_links":{"self":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4373"}],"version-history":[{"count":1,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4373\/revisions"}],"predecessor-version":[{"id":13241,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4373\/revisions\/13241"}],"wp:attachment":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}