snipt

Ctrl+h for KB shortcuts

Bash

Merge with --ours and --theirs

1
2
3
4
" Keep the current branch version
git checkout --ours <file_path>
" Keep the pulled version
git checkout --theirs <file_path>
https://snipt.net/embed/f0bc8d8c5eacfd5b08b4fbfcef1b3353/
/raw/f0bc8d8c5eacfd5b08b4fbfcef1b3353/
f0bc8d8c5eacfd5b08b4fbfcef1b3353
bash
Bash
4
2019-07-23T03:16:01
True
False
False
Jul 23, 2013 at 10:05 PM
/api/public/snipt/69258/
merge-with-ours-and-theirs
<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="s2">&quot; Keep the current branch version</span> </span><span id="L-2"><a name="L-2"></a><span class="s2">git checkout --ours &lt;file_path&gt;</span> </span><span id="L-3"><a name="L-3"></a><span class="s2">&quot;</span> Keep the pulled version </span><span id="L-4"><a name="L-4"></a>git checkout --theirs &lt;file_path&gt; </span></pre></div> </td></tr></table>
git