Difference between revisions of "Git"

From I2P Wiki
Jump to navigation Jump to search
(Add basic usage details)
(Mask timezone from commits)
Line 19: Line 19:
 
<nowiki>git clone --depth=1 http://git.idk.i2p/i2p-hackers/i2p.i2p.git</nowiki>
 
<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>.
 
The repository can then (step-by-step if needed) be unshallowed by <code>git pull --deepen=N</code>.
  +
  +
  +
* Git also 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 ==

Revision as of 21:28, 13 May 2024

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

Usage

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.

Useful tips

  • 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.


  • Git also 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

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