snipt

Ctrl+h for KB shortcuts

Bash

List of changed files between two revisions in SVN

svn log -vq -r123:456 | egrep '^ {3}[ADMR] ' | cut -c6- | sort | uniq
https://snipt.net/embed/5b57e150f4a656aa025f9763326dc658/
/raw/5b57e150f4a656aa025f9763326dc658/
5b57e150f4a656aa025f9763326dc658
bash
Bash
1
2019-08-19T12:12:45
True
False
False
/api/public/snipt/18521/
list-of-changed-files-between-two-revisions-in-svn
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>svn log -vq -r123:456 <span class="p">|</span> egrep <span class="s1">&#39;^ {3}[ADMR] &#39;</span> <span class="p">|</span> cut -c6- <span class="p">|</span> sort <span class="p">|</span> uniq </span></pre></div> </td></tr></table>
log, svn

Bash

Revert to an older revision in SVN

1
2
3
svn update 
svn merge -r 150:140 . 
svn commit -m "Rolled back to r140"
https://snipt.net/embed/62e7fbba6f3d2f79eaf4aff5a30c7cdd/
/raw/62e7fbba6f3d2f79eaf4aff5a30c7cdd/
62e7fbba6f3d2f79eaf4aff5a30c7cdd
bash
Bash
3
2019-08-19T12:12:59
True
False
False
/api/public/snipt/18518/
revert-to-an-older-revision-in-svn
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>svn update </span><span id="L-2"><a name="L-2"></a>svn merge -r 150:140 . </span><span id="L-3"><a name="L-3"></a>svn commit -m <span class="s2">&quot;Rolled back to r140&quot;</span> </span></pre></div> </td></tr></table>
svn

Bash

Ignore directories on SVN COMMIT, UPDATE, etc

svn propset svn:ignore "*" tool/templates_c
commit -m "ignored tool/templates_c"
https://snipt.net/embed/a04f8c5032d7021ae83c5027da29e8de/
/raw/a04f8c5032d7021ae83c5027da29e8de/
a04f8c5032d7021ae83c5027da29e8de
bash
Bash
2
2019-08-13T02:43:26
True
False
False
/api/public/snipt/18466/
ignore-directories-on-svn-commit-update-etc
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>svn propset svn:ignore <span class="s2">&quot;*&quot;</span> tool/templates_c </span><span id="L-2"><a name="L-2"></a>commit -m <span class="s2">&quot;ignored tool/templates_c&quot;</span> </span></pre></div> </td></tr></table>
commit, subversion, svn, update

ApacheConf

Htaccess Private Files (svn, cvs, sql, etc)

1
2
3
4
# Drupal's way of denying access to delicate server files
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
  Order allow,deny
</FilesMatch>
https://snipt.net/embed/5ce63763c77b5a0c9c89919d8f9720ef/
/raw/5ce63763c77b5a0c9c89919d8f9720ef/
5ce63763c77b5a0c9c89919d8f9720ef
apacheconf
ApacheConf
4
2019-08-15T03:49:59
True
False
False
/api/public/snipt/17855/
htaccess-private-files-svn-cvs-sql-etc
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c"># Drupal&#39;s way of denying access to delicate server files</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">&lt;FilesMatch</span> <span class="s">&quot;\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$&quot;</span><span class="nt">&gt;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">Order</span> allow,deny </span><span id="L-4"><a name="L-4"></a><span class="nt">&lt;/FilesMatch&gt;</span> </span></pre></div> </td></tr></table>
apache, htaccess, svn

Bash

svn ignore passwords

1
2
3
# on production servers its often a good idea not to store svn passwords.
# heres a one-liner to do just that:
echo "store-passwords=no" >> ~/.subversion/servers && rm -f ~/.subversion/auth/svn.simple/*
https://snipt.net/embed/0f35da9488147f9ec6e8da7bb5aa4ee7/
/raw/0f35da9488147f9ec6e8da7bb5aa4ee7/
0f35da9488147f9ec6e8da7bb5aa4ee7
bash
Bash
3
2019-08-09T04:36:21
True
False
False
/api/public/snipt/17344/
svn-ignore-passwords
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># on production servers its often a good idea not to store svn passwords.</span> </span><span id="L-2"><a name="L-2"></a><span class="c1"># heres a one-liner to do just that:</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">echo</span> <span class="s2">&quot;store-passwords=no&quot;</span> &gt;&gt; ~/.subversion/servers <span class="o">&amp;&amp;</span> rm -f ~/.subversion/auth/svn.simple/* </span></pre></div> </td></tr></table>
bash, development, production, svn

Bash

grep find

1
2
3
# grep find excluding .svn directories
# from http://wordaligned.org/articles/ignoring-svn-directories
alias gf='find . -path "*/.svn" -prune -o -type f -print0 | xargs -0 grep -I -n'
https://snipt.net/embed/5c082212da395c882bd0a1e04f1eecbe/
/raw/5c082212da395c882bd0a1e04f1eecbe/
5c082212da395c882bd0a1e04f1eecbe
bash
Bash
3
2019-08-09T09:41:00
True
False
False
/api/public/snipt/15710/
grep-find
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># grep find excluding .svn directories</span> </span><span id="L-2"><a name="L-2"></a><span class="c1"># from http://wordaligned.org/articles/ignoring-svn-directories</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">alias</span> <span class="nv">gf</span><span class="o">=</span><span class="s1">&#39;find . -path &quot;*/.svn&quot; -prune -o -type f -print0 | xargs -0 grep -I -n&#39;</span> </span></pre></div> </td></tr></table>
bash, search, svn

Bash

find exclude .svn

# exclude .svn folders with find
find . -name "myfile*.*" \( -not -iname "*.svn*" \)
https://snipt.net/embed/6bc472a3f4cd9cc340f9bce561e5bdad/
/raw/6bc472a3f4cd9cc340f9bce561e5bdad/
6bc472a3f4cd9cc340f9bce561e5bdad
bash
Bash
3
2019-08-11T05:29:10
True
False
False
/api/public/snipt/15709/
find-exclude-svn
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># exclude .svn folders with find</span> </span><span id="L-2"><a name="L-2"></a>find . -name <span class="s2">&quot;myfile*.*&quot;</span> <span class="se">\(</span> -not -iname <span class="s2">&quot;*.svn*&quot;</span> <span class="se">\)</span> </span></pre></div> </td></tr></table>
bash, search, svn

Bash

Recursive revert all external items on svn WC

for i in $(svn status | grep ^Perf | cut -d\' -f 2); do svn revert -R $i ; done
https://snipt.net/embed/29a9c8adb6033617550ff4ba5da6bfcb/
/raw/29a9c8adb6033617550ff4ba5da6bfcb/
29a9c8adb6033617550ff4ba5da6bfcb
bash
Bash
1
2019-08-20T20:40:25
True
False
False
/api/public/snipt/15566/
recursive-revert-all-external-items-on-svn-wc
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">for</span> i in <span class="k">$(</span>svn status <span class="p">|</span> grep ^Perf <span class="p">|</span> cut -d<span class="se">\&#39;</span> -f 2<span class="k">)</span><span class="p">;</span> <span class="k">do</span> svn revert -R <span class="nv">$i</span> <span class="p">;</span> <span class="k">done</span> </span></pre></div> </td></tr></table>
recursive, revert, svn, wc

Text only

Subversion command to change repo

svn switch --relocation http://existing/url to http://new/url
https://snipt.net/embed/83bbd31666bde55eeb4e2a53939fc2e3/
/raw/83bbd31666bde55eeb4e2a53939fc2e3/
83bbd31666bde55eeb4e2a53939fc2e3
text
Text only
1
2019-07-30T09:50:15
True
False
False
/api/public/snipt/14689/
subversion-command-to-change-repo
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>svn switch --relocation http://existing/url to http://new/url </span></pre></div> </td></tr></table>
subversion, svn