snipt

Ctrl+h for KB shortcuts

Text only

hackpull

1
2
3
4
5
6
7
#!/bin/sh -x
# git name-rev is fail
CURRENT=`git branch | grep '\*' | awk '{print $2}'`
git checkout master
git pull origin master
git checkout ${CURRENT}
git rebase master
https://snipt.net/embed/0ed0b9dd82e61b568ed2c7fc42f700b1/
/raw/0ed0b9dd82e61b568ed2c7fc42f700b1/
0ed0b9dd82e61b568ed2c7fc42f700b1
text
Text only
9
2019-06-26T18:56:00
True
False
False
/api/public/snipt/5838/
hackpull
<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> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>#!/bin/sh -x </span><span id="L-2"><a name="L-2"></a># git name-rev is fail </span><span id="L-3"><a name="L-3"></a>CURRENT=`git branch | grep &#39;\*&#39; | awk &#39;{print $2}&#39;` </span><span id="L-4"><a name="L-4"></a>git checkout master </span><span id="L-5"><a name="L-5"></a>git pull origin master </span><span id="L-6"><a name="L-6"></a>git checkout ${CURRENT} </span><span id="L-7"><a name="L-7"></a>git rebase master </span></pre></div> </td></tr></table>
git