36 lines
4.7 KiB
HTML
36 lines
4.7 KiB
HTML
{% extends "global/layout.html" %}
|
||
{% block title %}{% trans %}Setting up Gitlab with I2P{% endtrans %}{% endblock %}
|
||
{% block lastupdated %}2020-09{% endblock %}
|
||
{% block accuratefor %}0.9.47{% endblock %}
|
||
{% block content %}
|
||
<h1 id="using-a-git-bundle-to-fetch-the-i2p-source-code">{% trans -%}Using a git bundle to fetch the I2P source code{%- endtrans %}</h1>
|
||
<p>{% trans -%} Cloning large software repositories over I2P can be difficult, and using git can sometimes make this harder. Fortunately, it can also sometimes make it easier. Git has a <code>git bundle</code> command which can be used to turn a git repository into a file which git can then clone, fetch, or import from a location on your local disk. By combining this capability with bittorrent downloads, we can solve our remaining problems with <code>git clone</code>. {%- endtrans %}</p>
|
||
<h2 id="before-you-start">{% trans -%}Before you Start{%- endtrans %}</h2>
|
||
<p>{% trans -%} If you intend to generate a git bundle, you <strong>must</strong> already possess a full copy of the <strong>git</strong> repository, not the mtn repository. You can get it from github or from git.idk.i2p, but a shallow clone(a clone done to –depth=1) <em>will not</em> <em>work</em>. It will fail silently, creating what looks like a bundle, but when you try to clone it it will fail. If you are just retrieving a pre-generated git bundle, then this section does not apply to you. {%- endtrans %}</p>
|
||
<h2 id="fetching-i2p-source-via-bittorrent">{% trans -%}Fetching I2P Source via Bittorrent{%- endtrans %}</h2>
|
||
<p>{% trans -%} Someone will need to supply you with a torrent file or a magnet link corresponding to an existing <code>git bundle</code> that they have already generated for you. A recent, correctly-generated bundle of the mainline i2p.i2p source code as-of Wednesday, March 18, 2020, can be found inside of I2P at my pastebin <a href="http://paste.idk.i2p/f/4h137i">paste.idk.i2p/f/4hq37i</a>. {%- endtrans %}</p>
|
||
<p>{% trans -%} Once you have a bundle, you will need to use git to create a working repository from it. If you’re using GNU/Linux and i2psnark, the git bundle should be located in $HOME/.i2p/i2psnark or, as a service on Debian, /var/lib/i2p/i2p-config/i2psnark. If you are using BiglyBT on GNU/Linux, it is probably at “$HOME/BiglyBT Downloads/” instead. The examples here assume I2PSnark on GNU/Linux, if you use something else, replace the path to the bundle with the download directory preferred by your client and platform. {%- endtrans %}</p>
|
||
<h3 id="using-git-clone">{% trans -%}Using <code>git clone</code>{%- endtrans %}</h3>
|
||
<p>{% trans -%}Cloning from a git bundle is easy, just:{%- endtrans %}</p>
|
||
<pre><code>git clone $HOME/.i2p/i2psnark/i2p.i2p.bundle</code></pre>
|
||
<p>{% trans -%}If you get the following error, try using git init and git fetch manually instead.{%- endtrans %}</p>
|
||
<pre><code>fatal: multiple updates for ref 'refs/remotes/origin/master' not allowed</code></pre>
|
||
<h3 id="using-git-init-and-git-fetch">{% trans -%}Using <code>git init</code> and <code>git fetch</code>{%- endtrans %}</h3>
|
||
<p>{% trans -%}First, create an i2p.i2p directory to turn into a git repository.{%- endtrans %}</p>
|
||
<pre><code>mkdir i2p.i2p && cd i2p.i2p</code></pre>
|
||
<p>{% trans -%}Next, initialize an empty git repository to fetch changes back into.{%- endtrans %}</p>
|
||
<pre><code>git init</code></pre>
|
||
<p>{% trans -%}Finally, fetch the repository from the bundle.{%- endtrans %}</p>
|
||
<pre><code>git fetch $HOME/.i2p/i2psnark/i2p.i2p.bundle</code></pre>
|
||
<h3 id="replace-the-bundle-remote-with-the-upstream-remote">{% trans -%}Replace the bundle remote with the upstream remote{%- endtrans %}</h3>
|
||
<p>{% trans -%} Now that you have a bundle, you can keep up with changes by setting the remote to the upstream repository source. {%- endtrans %}</p>
|
||
<pre><code>git remote set-url origin git@127.0.0.1:i2p-hackers/i2p.i2p</code></pre>
|
||
<h2 id="generating-a-bundle">{% trans -%}Generating a Bundle{%- endtrans %}</h2>
|
||
<p>{% trans -%} First, follow the <a href="GIT.md">Git guide for Users</a> until you have a successfully <code>--unshallow</code>ed clone of clone of the i2p.i2p repository. If you already have a clone, make sure you run <code>git fetch --unshallow</code> before you generate a torrent bundle. {%- endtrans %}</p>
|
||
<p>{% trans -%}Once you have that, simply run the corresponding ant target:{%- endtrans %}</p>
|
||
<pre><code>ant bundle</code></pre>
|
||
<p>{% trans -%} and copy the resulting bundle into your I2PSnark downloads directory. For instance: {%- endtrans %}</p>
|
||
<pre><code>cp i2p.i2p.bundle* $HOME/.i2p/i2psnark/</code></pre>
|
||
<p>{% trans -%} In a minute or two, I2PSnark will pick up on the torrent. Click on the “Start” button to begin seeding the torrent. {%- endtrans %}</p>
|
||
{% endblock %}
|