{"id":482,"date":"2008-10-18T10:14:33","date_gmt":"2008-10-18T10:14:33","guid":{"rendered":"https:\/\/virtualchaos.co.uk\/blog\/?p=482"},"modified":"2008-10-18T10:17:00","modified_gmt":"2008-10-18T10:17:00","slug":"svn-useful-bash-commands","status":"publish","type":"post","link":"https:\/\/virtualchaos.co.uk\/blog\/2008\/10\/18\/svn-useful-bash-commands\/","title":{"rendered":"SVN: Useful bash commands"},"content":{"rendered":"<p>\nHere&#8217;s a couple of useful bash commands I&#8217;ve been using recently when working with Subversion:\n<\/p>\n<p>The first helps me with an annoyance I have with externals. Normally doing a &#8220;svn st &#8211;ignore-externals&#8221; still lists all the externals even though I&#8217;m not actually interesting in seeing them when I want to know what I&#8217;ve changed locally. For example in the output below I only really want to know that I&#8217;ve changed &#8216;development-tenants.xml&#8217;, i&#8217;m not really interested in the rest.\n<\/p>\n<blockquote>\n<pre>Nadeems-Computer:zephyr-trunk nadeemshabir$ svn st --ignore externals\r\nX      lib\/arc\r\nX      lib\/moriarty\r\nX      lib\/simpleSAMLphp\r\nX      3rdPartyDevelopmentTools\/svnant-1.0.0\r\nX      3rdPartyDevelopmentTools\/PHPUnit\r\nX      3rdPartyDevelopmentTools\/selenium-server-1.0-beta-1\r\nX      3rdPartyDevelopmentTools\/selenium-core-0.8.3\r\nM      developmentdata\/development-tenants.xml<\/pre>\n<\/blockquote>\n<p>\nTo address this the first command is an alias I&#8217;ve created that shows me all the files that I&#8217;ve changed\/added\/removed locally but specifically doesn&#8217;t list anything related to any externals<\/p>\n<blockquote>\n<pre>alias whatschanged='svn st --ignore-externals | grep -v \"^X \"'<\/pre>\n<\/blockquote>\n<p>\nThe second bash command deals with the fact that I often have a large number of files I want to add to subversion all at once. This command takes all un-added files and adds them to subversion &#8230;\n<\/p>\n<blockquote>\n<pre>\r\nsvn st | grep '^? ' | awk '{ print $2 }' | xargs svn add\r\n<\/pre>\n<\/blockquote>\n<p>Hope you find them useful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a couple of useful bash commands I&#8217;ve been using recently when working with Subversion: The first helps me with an annoyance I have with externals. Normally doing a &#8220;svn st &#8211;ignore-externals&#8221; still lists all the externals even though I&#8217;m &hellip; <a href=\"https:\/\/virtualchaos.co.uk\/blog\/2008\/10\/18\/svn-useful-bash-commands\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[272,174,273],"class_list":["post-482","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bash-one-liner","tag-subversion","tag-svn"],"_links":{"self":[{"href":"https:\/\/virtualchaos.co.uk\/blog\/wp-json\/wp\/v2\/posts\/482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtualchaos.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtualchaos.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtualchaos.co.uk\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/virtualchaos.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=482"}],"version-history":[{"count":0,"href":"https:\/\/virtualchaos.co.uk\/blog\/wp-json\/wp\/v2\/posts\/482\/revisions"}],"wp:attachment":[{"href":"https:\/\/virtualchaos.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualchaos.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualchaos.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}