You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to serve a static Git repository worldwide using IPFS, the InterPlanetary File System.
4
+
description: Learn how to serve a static Git repository worldwide using IPFS
5
5
---
6
6
7
-
# Host a Git-style repo
7
+
# Host a Git repo
8
8
9
9
Have you ever said to yourself: "Man, my Git server isn't distributed enough" or "I wish I had an easy way to serve a static Git repository worldwide"? Well, wish no more.
10
10
@@ -13,7 +13,7 @@ In this guide, we discuss how to serve a Git repository through the IPFS network
13
13
To start, select a Git repository you want to host, and do a bare clone of it:
14
14
15
15
```bash
16
-
git clone --bare git@myhost.io/myrepo
16
+
git clone --mirror git@myhost.io/myrepo
17
17
```
18
18
19
19
For those who aren't super Git-savvy, a bare repository means that it doesn't have a working tree, and can be used as a server. They have a slightly different format than your normal Git repository.
Note: make sure to change out that hash for yours.
58
58
59
-
Now, you may be asking "Well, what good is a Git repository that I can't change anything on?" Here's one use case. Say you program in Go. For those who don't know, Go uses version control paths for its imports, i.e:
59
+
Now, you may be asking, "Well, what good is a Git repository that I can't change anything on?" Here's one use case. Say you program in Go. For those who don't know, Go uses version control paths for its imports, i.e:
60
60
61
61
```go
62
62
import (
@@ -78,3 +78,4 @@ import (
78
78
And you will be guaranteed to have the same code every time!
79
79
80
80
Note: Since Go doesn't allow the usage of localhost for import paths, we use the public HTTP gateways. This provides no security guarantees, as a man-in-the-middle attack could ship you bad code. You could use a domain name that redirects to the localhost instead to avoid the issue.
0 commit comments