Difference between revisions of "Git"

From I2P Wiki
Jump to navigation Jump to search
(throw out wikipedia copy and write a small one)
Tag: Replaced
(→‎Servers: add link)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[https://git-scm.com/ Git] is a version control system used by I2P, replacing the previous system [[Monotone]] in late 2020.<ref>http://i2p-projekt.i2p/en/blog/post/2020/12/10/Hello-git-goodbye-mtn</ref>
 
[https://git-scm.com/ Git] is a version control system used by I2P, replacing the previous system [[Monotone]] in late 2020.<ref>http://i2p-projekt.i2p/en/blog/post/2020/12/10/Hello-git-goodbye-mtn</ref>
  +
  +
== Usage & tips ==
  +
  +
=== Telling Git to use I2P ===
  +
To use HTTP/Git-based I2P servers, Git's proxy settings must be configured. This can be achieved by adding these lines to your <code>~/.gitconfig</code> (create if necessary):
  +
<nowiki>[http]
  +
proxy = http://127.0.0.1:4444
  +
[https]
  +
proxy = http://127.0.0.1:4444
  +
[git]
  +
proxy = http://127.0.0.1:4444</nowiki>
  +
If the proxy is needed for only a few repos, one can also utilize the <code>-c</code> of Git:
  +
<nowiki>git -c http.proxy=http://127.0.0.1:4444 clone http://example.i2p/myrepo.git</nowiki>
  +
Note that this method doesn't store the proxy information within the repo configuration, so the same <code>-c http.proxy=...</code> settings must be applied on each invocation.
  +
  +
=== Limit fetched commits ===
  +
Git (by default) fetches the full history of a repo, which can be hard for I2P connections to sustain. Git provides the <code>--depth=N</code> argument to only fetch N commits from the top:
  +
<nowiki>git clone --depth=1 http://git.idk.i2p/i2p-hackers/i2p.i2p.git</nowiki>
  +
The repository can then (step-by-step if needed) be unshallowed by <code>git pull --deepen=N</code>.
  +
  +
=== Hide timezone ===
  +
Git shows the local timezone in commits. You might want to change that to something more generic, such as UTC.
  +
  +
<nowiki>git commit --date="`date --utc +%Y-%m-%dT%H:%M:%S%z`" -m "added new feature"</nowiki>
   
 
== Servers ==
 
== Servers ==
  +
{{Main|Eepsite/Services#Code}}
  +
 
There are several Git services within I2P.
 
There are several Git services within I2P.
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"

Latest revision as of 22:46, 14 May 2024

Git is a version control system used by I2P, replacing the previous system Monotone in late 2020.[1]

Usage & tips

Telling Git to use I2P

To use HTTP/Git-based I2P servers, Git's proxy settings must be configured. This can be achieved by adding these lines to your ~/.gitconfig (create if necessary):

[http]
    proxy = http://127.0.0.1:4444
[https]
    proxy = http://127.0.0.1:4444
[git]
    proxy = http://127.0.0.1:4444

If the proxy is needed for only a few repos, one can also utilize the -c of Git:

git -c http.proxy=http://127.0.0.1:4444 clone http://example.i2p/myrepo.git

Note that this method doesn't store the proxy information within the repo configuration, so the same -c http.proxy=... settings must be applied on each invocation.

Limit fetched commits

Git (by default) fetches the full history of a repo, which can be hard for I2P connections to sustain. Git provides the --depth=N argument to only fetch N commits from the top:

git clone --depth=1 http://git.idk.i2p/i2p-hackers/i2p.i2p.git

The repository can then (step-by-step if needed) be unshallowed by git pull --deepen=N.

Hide timezone

Git shows the local timezone in commits. You might want to change that to something more generic, such as UTC.

git commit --date="`date --utc +%Y-%m-%dT%H:%M:%S%z`" -m "added new feature"

Servers

Main page: Eepsite/Services#Code

There are several Git services within I2P.

Name AH/B32 Description
git.idk.i2p AH B32 idk's GitLab service, hosts I2P's code
git.community.i2p AH B32 Gitea based Git hosting

Setup guides

References

External links