<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:default="http://www.w3.org/1999/xhtml">
  <title xmlns="http://www.w3.org/2005/Atom">Dobrica Pavlinušić's random unstructured stuff: Git</title>
  <id xmlns="http://www.w3.org/2005/Atom">https://saturn.ffzg.hr/rot13/</id>
  <link xmlns="http://www.w3.org/2005/Atom" type="text/html" rel="alternate" href="https://saturn.ffzg.hr/rot13/index.cgi?git"/>
  <link xmlns="http://www.w3.org/2005/Atom" type="application/atom+xml" rel="self" href="https://saturn.ffzg.hr%2C%20saturn.ffzg.hr:443/feed/workspace/rot13?page=git;type=Atom"/>
  <updated xmlns="http://www.w3.org/2005/Atom">2010-09-17T09:19:26Z</updated>
  <entry xmlns="http://www.w3.org/2005/Atom" xmlns:default="http://www.w3.org/1999/xhtml">
    <title xmlns="http://www.w3.org/2005/Atom">Git</title>
    <link xmlns="http://www.w3.org/2005/Atom" type="text/html" rel="alternate" href="https://saturn.ffzg.hr/rot13/index.cgi?git"/>
    <content xmlns="http://www.w3.org/2005/Atom" xmlns:default="http://www.w3.org/1999/xhtml" type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml"><div>Creator: Dobrica Pavlinušić</div><hr/><div>Tags: git</div><hr/><div class="wiki">
<span class="nlw_phrase"><a href="https://saturn.ffzg.hr/rot13/index.cgi/gitweb-ssl%2Bhtdigest.diff?action=attachments_download;page_name=git;id=20100225144600-0-20719">gitweb-ssl+htdigest.diff</a><!-- wiki: {file: gitweb-=ssl+htdigest.diff} --></span><br/><br/><p>
This is my notebook with useful (to me) git hints</p>
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [Dobrica Pavlinušić's random unstructured stuff]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#resolve_merge_conflict">Dobrica Pavlinušić's random unstructured stuff (Resolve merge conflict)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Resolve merge conflict} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#list_files_which_have_conflicts">Dobrica Pavlinušić's random unstructured stuff (List files which have conflicts)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] List files which have conflicts} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#checkout_all_three_versions">Dobrica Pavlinušić's random unstructured stuff (Checkout all three versions)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Checkout all three versions} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#mark_conflict_resolved">Dobrica Pavlinušić's random unstructured stuff (Mark conflict resolved)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Mark conflict resolved} --></span></li>
</ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#migrate_google_code_project_to_github">Dobrica Pavlinušić's random unstructured stuff (Migrate google code project to github)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Migrate google code project to github} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#svn_git_error_unable_to_extract_revision_information_from_commit">Dobrica Pavlinušić's random unstructured stuff (svn git error: Unable to extract revision information from commit)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] svn git error: Unable to extract revision information from commit} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#github_setup">Dobrica Pavlinušić's random unstructured stuff (github setup)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] github setup} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#recover_delted_files">Dobrica Pavlinušić's random unstructured stuff (recover delted files)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] recover delted files} --></span></li>
</ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br/><br/><h1 id="resolve_merge_conflict">Resolve merge conflict</h1>
<h2 id="list_files_which_have_conflicts">List files which have conflicts</h2>
<pre>
$ git ls-files --unmerged
100644 435b838c30242833e667538c19119e972c30d1cc 1       target-ppc/cpu.h
100644 f5db1cec931da9781f65a0a6b2678370862f6d51 2       target-ppc/cpu.h
100644 f1df741e1e50bea39ae21118f1faab56a06d8a74 3       target-ppc/cpu.h
100644 60e3a36f1c55912a468694ca2c2712abf31f3d57 1       target-ppc/translate_init.c
100644 910fdd1d186f57c29c9d2044401290073ad78fe7 2       target-ppc/translate_init.c
100644 cc8333f92836441fe20c14c7a26bb959a05a3968 3       target-ppc/translate_init.c
</pre>
<br/><h2 id="checkout_all_three_versions">Checkout all three versions</h2>
<pre>
$ git cat-file blob :1:target-ppc/cpu.h &gt; target-ppc/cpu.h.1
$ git cat-file blob :2:target-ppc/cpu.h &gt; target-ppc/cpu.h.2
$ git cat-file blob :3:target-ppc/cpu.h &gt; target-ppc/cpu.h.3
</pre>
<br/><p>
Make a diff, and create one copy which will be final with all changes merged</p>
<h2 id="mark_conflict_resolved">Mark conflict resolved</h2>
<pre>
$ git update-index target-ppc/cpu.h
</pre>
<br/><h1 id="migrate_google_code_project_to_github">Migrate google code project to github</h1>
<pre>
dpavlin@t61p:/rest/cvs$ git svn clone -s -A ~/.gitauthors https://perl-cwmp.googlecode.com/svn/ perl-cwmp
</pre>
<br/><h1 id="svn_git_error_unable_to_extract_revision_information_from_commit">svn git error: Unable to extract revision information from commit</h1>
<pre>
# start with the svn head
git checkout -b tempbranch trunk
# bring in all the changes from your branch
git merge --squash myhead
# commit with whatever message you want
git commit
# and ship it up to svn land
git svn dcommit

</pre>
<br/><h1 id="github_setup">github setup</h1>
<pre>
$ git config --global user.name "Dobrica Pavlinusic"
$ git config --global user.email "dpavlin@rot13.org"
</pre>
<br/><h1 id="recover_delted_files">recover delted files</h1>
<pre>
$ git add something
$ git reset --hard # WOOPS!

$ git fsck --lost-found
</pre>
</div>
<hr/><div>Attachments: gitweb-ssl+htdigest.diff</div></div>
    </content>
    <id xmlns="http://www.w3.org/2005/Atom">https://saturn.ffzg.hr/rot13/index.cgi?git</id>
    <author xmlns="http://www.w3.org/2005/Atom">
      <name xmlns="http://www.w3.org/2005/Atom">Dobrica Pavlinušić</name>
    </author>
    <updated xmlns="http://www.w3.org/2005/Atom">2010-09-17T09:19:26Z</updated>
    <category xmlns="http://www.w3.org/2005/Atom" term="git" label="git"/>
  </entry>
</feed>
