Difference between revisions of "Git"
Editor2023 (talk | contribs) (Mask timezone from commits) |
(→Servers: add link) |
||
(One intermediate revision by the same user 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 == |
+ | == Usage & tips == |
=== Telling Git to use I2P === |
=== Telling Git to use I2P === |
||
Line 15: | Line 15: | ||
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. |
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> |
<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>. |
||
+ | === 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> |
<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
- In-Network: http://i2p-projekt.i2p/en/docs/applications/git - Git over I2P for users
- Clearnet: https://geti2p.net/en/docs/applications/git - Git over I2P for users