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 git bundle 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 git clone.
Прежде чем начать
If you intend to generate a git bundle, you must already possess a full copy of the git 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) will not work. 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.
Получение исходного кода I2P через Bittorrent
Someone will need to supply you with a torrent file or a magnet link corresponding to an existing git bundle 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 paste.idk.i2p/f/4hq37i. You can also use a magnet link, and if you're a BiglyBT user who wants to bridge the torrent, use this magnet link instead to announce to clearnet trackers as well.
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.
Using git clone
Клонирование из git-пакета очень просто:
git clone $HOME/.i2p/i2psnark/i2p.i2p.bundle
If you get the following error, try using git init and git fetch manually instead.
fatal: multiple updates for ref 'refs/remotes/origin/master' not allowed
Using git init and git fetch
Сначала создайте каталог i2p.i2p, чтобы превратить его в git-репозиторий.
mkdir i2p.i2p && cd i2p.i2p
Затем инициализируйте пустой git-репозиторий для получения изменений.
git init
И извлеките репозиторий из бандл.
git fetch $HOME/.i2p/i2psnark/i2p.i2p.bundle
Replace the bundle remote with the upstream remote
Теперь, когда у вас есть бандл, вы можете следить за изменениями, установив remote на источник репозитория upstream.
git remote set-url origin git@127.0.0.1:i2p-hackers/i2p.i2p
Generating a Bundle
First, follow the Git guide for Users until you have a successfully --unshallowed clone of clone of the i2p.i2p repository. If you already have a clone, make sure you run git fetch --unshallow before you generate a torrent bundle.
После этого просто запустите соответствующую цель:
ant bundle
and copy the resulting bundle into your I2PSnark downloads directory. For instance:
cp i2p.i2p.bundle* $HOME/.i2p/i2psnark/
Через минуту или две I2PSnark подхватит торрент. Нажмите на кнопку "Старт", чтобы начать раздачу торрента.