Using I2P Mirror with Git
I2P Mirror is a Git host. You keep your code in repositories here and work on it with the ordinary git command line, from any computer.
Create an account
Sign up with a username, an email address and a password, or sign in. Your username is the owner name in your repositories' addresses, for example https://i2p.forkmesh.com/you/project.
Create a repository
- Open New repository (Dashboard, Repositories, New).
- Choose the owner (you or one of your organizations) and a name. Names use letters, numbers,
.,_and-. - Choose Public (anyone can browse and clone it) or Private (only you and your organization can).
- Optionally start it with a README, a
.gitignoreand a license, then create it.
To bring in an existing project, give the address of a public repository on GitHub, GitLab, Codeberg or Gitea as the source and I2P Mirror copies it with its history.
Clone a repository
Every repository page shows its clone address. Clone it with:
git clone https://i2p.forkmesh.com/owner/repository.gitPublic repositories clone without signing in. A private repository asks for your username and push password (below).
Push your work
When you create a repository, I2P Mirror shows the commands to use and a username (your account name) and a password for Git. Copy the password then: it is shown once and lasts 7 days.
For a new, empty repository:
git init
git add .
git commit -m "First commit"
git branch -M main
git remote add origin https://i2p.forkmesh.com/owner/repository.git
git push -u origin mainFor a repository you cloned, commit and run git push. When Git asks, give your username and the password. A credential helper (git config --global credential.helper cache) saves typing it on every push.
What the server accepts
- The default branch and protected branches only move forward: a force push to them is refused.
- Other branches you may write can be force-pushed after a rebase or amend. Use
git push --force-with-lease; the previous tip is kept, and an open pull request records the update. - A push to the branch of an open pull request updates the pull request: its diff, commits and checks follow the new commits.
- A push never deletes a branch; delete it on the repository's Branches page.
- New tags can be pushed; an existing tag never moves.
- Only branches (
refs/heads/*) and tags (refs/tags/*).
If a push is refused because the branch moved on the server (for example after Update branch or a web edit), run git pull --rebase and push again.
Branches
git switch -c my-change
# edit, then
git commit -am "Describe the change"
git push -u origin my-changeThe repository page lists every branch, and the compare view shows what a branch changes against another.
Forks
A fork is your own copy of someone else's repository that keeps its history. Open the repository, click Fork, and push your changes to your fork. The Fork menu also lists who else has forked it.
Pull requests
- Push your changes to a branch, in the repository or in your fork.
- Open the repository's Pull requests tab and choose New pull request.
- Choose the base branch (where the change should go) and your branch, write a title and a description, and send it.
The owner reviews it, comments on lines, and merges it. A pull request is a signed patch, so the owner can review it even while your fork is offline.
Forks on other instances
The same project can live on more than one instance, for example here and on another server. Link them, and you can send pull requests from one to the other:
- On your repository, open the Fork menu and, under Forks on other instances, enter the other copy's address, such as
https://git.example.org/owner/repository, and save it. - Choose New pull request. In Send to, pick the saved fork, then choose the base branch and your branch.
- I2P Mirror compares the branches here, signs the patch in your browser and delivers it to the other instance, which shows it in that repository's pull requests.
Both copies need to share history: the base branch you pick must exist here too.
Issues
Each repository has an Issues tab to report bugs and plan work. Mention people with @name and refer to an issue or pull request with #number.
The desktop app
Everything above works with plain git. If you prefer a desktop app, the desktop app works with I2P Mirror: download it and connect it.