<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Colas.Nahaboo.net - vcs</title>
    <subtitle>Colas Nahaboo personal site, with discussions about programming code, web and computing topics, surfing and SUPing, and various musings.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://colas.nahaboo.net/tags/vcs/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://colas.nahaboo.net"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2021-12-10T00:00:00+00:00</updated>
    <id>https://colas.nahaboo.net/tags/vcs/atom.xml</id>
    <entry xml:lang="en">
        <title>Moving to Github</title>
        <published>2021-12-10T00:00:00+00:00</published>
        <updated>2021-12-10T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://colas.nahaboo.net/code/moving-to-github/"/>
        <id>https://colas.nahaboo.net/code/moving-to-github/</id>
        
        <content type="html" xml:base="https://colas.nahaboo.net/code/moving-to-github/">&lt;p&gt;&lt;strong&gt;Warning:&lt;&#x2F;strong&gt; I will move all the sources I maintained on my own &lt;strong&gt;mercurial&lt;&#x2F;strong&gt; web instance in &lt;code&gt;hg.colas.nahaboo.net&lt;&#x2F;code&gt;  to my GitHub repositories: https:&#x2F;&#x2F;github.com&#x2F;ColasNahaboo&#x2F;&lt;&#x2F;p&gt;
&lt;p&gt;I have thus redirected the non-functional &lt;code&gt;hg.colas.nahaboo.net&lt;&#x2F;code&gt; to this page.&lt;&#x2F;p&gt;
&lt;p&gt;The move will be gradual, I started with &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ColasNahaboo&#x2F;rsync-incr&quot;&gt;rsync-incr&lt;&#x2F;a&gt;, and I hope to have finished before the end of 2021. Please ask me is you do not see yet your favorite source there.&lt;&#x2F;p&gt;
&lt;p&gt;The reason is that Debian has phased out most of what the web tools for mercurial rely on (python2, wsgi, ...), and thus my web hg repository was broken. And since I wanted anyways to move it to GitHub, it is not worth repairing it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;how-to-move-mercurial-hg-directories-to-github&quot;&gt;How to move mercurial (hg) directories to GitHub&lt;a class=&quot;zola-anchor&quot; href=&quot;#how-to-move-mercurial-hg-directories-to-github&quot; aria-label=&quot;Anchor link for: how-to-move-mercurial-hg-directories-to-github&quot;&gt;🔗&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;As my hg repositories were very simple (no branches, I tend to use cloned repos than branches), what I do to migrate a repository &lt;code&gt;foo&lt;&#x2F;code&gt; to github:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;I used &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;repo.or.cz&#x2F;fast-export.git&quot;&gt;hg-fast-export&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;I converted the hg repo of &lt;code&gt;foo&lt;&#x2F;code&gt; to a local git repository of the same name, with the main hg branch mapped to github default &lt;code&gt;main&lt;&#x2F;code&gt; instead of the script default of &lt;code&gt;master&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;I created an &lt;strong&gt;empty&lt;&#x2F;strong&gt; repository &lt;code&gt;foo&lt;&#x2F;code&gt; on github (no files such as README.md, LICENSE, ...)&lt;&#x2F;li&gt;
&lt;li&gt;I added it as origin to my local git repo&lt;&#x2F;li&gt;
&lt;li&gt;I deleted my hg repo, and git-pushed my local git repo (which became my working repo) to github. Plus I redirected the old hgweb repo urls to the new github repo adress.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;I.e. as actual bash commands:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #4C4F69; background-color: #EFF1F5;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;repo=foo                        # the name of the repo to convert&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;hg=~&#x2F;hg                         # where are my local hg repos&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;git=~&#x2F;git                       # where are my local git repos&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;hfe=&#x2F;opt&#x2F;fast-export            # where is my copy of hg-fast-export.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ghn=ColasNahaboo                # my name on github&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mkdir $git&#x2F;$repo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cd $git&#x2F;$repo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;git init&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$hfe&#x2F;hg-fast-export.sh -r &amp;quot;$hg&#x2F;$repo&amp;quot; -M main -n &amp;quot;$git&#x2F;$repo&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;git branch -M main&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;git checkout main&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;git remote add origin git@github.com:$ghn&#x2F;$repo.git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Warning: for this last step, the github repo must exist and be empty&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;git push -u origin main&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</content>
        
    </entry>
</feed>
