mygit

[UNMAINTAINED] A cgit/webgit alternative, written in Rust
git clone git://git.alexwennerberg.com/mygit
Log | Files | Refs | README | LICENSE

README.md (3432B)


      1 # mygit
      2 
      3 NOTE: This project is not actively developed. I decided to use cgit instead.
      4 
      5 Simple self-hosted git server, written in Rust
      6 
      7 Lighter weight than [gitea](https://gitea.io/en-us/), more modern than
      8 [cgit](https://git.zx2c4.com/cgit/) or
      9 [gitweb](https://git-scm.com/book/en/v2/Git-on-the-Server-GitWeb). For people
     10 who want to run a git server themselves, rather than depending on someone else,
     11 but don't want to put too much work into it.
     12 
     13 ## Deploying
     14 Build your binary with `cargo build --release`. Then probably move it somewhere
     15 sensible so it's in your $PATH or use `cargo install --release`. Packages and
     16 prebuilt binaries are TBD.
     17 
     18 Probably you want to use your linux distro's init system to keep this server
     19 running.
     20 
     21 ## Setting up your repos
     22 Acquire a Linux server that you have ssh access to, and decide on the best
     23 place to place your repos. You can also do this locally to experiment with it.
     24 
     25 To initialize a repo, you'll need to run a few commands. I'm using a
     26 self-hosted instance of the mygit repo as an example. Find a directory where
     27 you want to host your repositories. This is using the default settings found in
     28 `mygit.toml` 
     29 
     30 ```
     31 git init --bare mygit
     32 cd mygit
     33 touch git-daemon-export-ok
     34 # update "dumb http" server on updates
     35 mv hooks/post-update.sample hooks/post-update
     36 ```
     37 Update the `description` file with a description of the repository
     38 
     39 Make sure the HEAD in your remote repo points to your default branch (e.g. master vs main)
     40 
     41 Pushing your changes is not handled via mygit -- this will be done over ssh. For example:
     42 ```
     43 git remote add origin ssh://git@git.alexwennerberg.com:/www/git/mygit
     44 git push -u origin main
     45 ```
     46 
     47 Set up a reverse proxy on an http server which forwards port 8081 (or whatever port you configure) to your mygit server. 
     48 
     49 ## Why self-host?
     50 Self-hosting provides self-reliance and independence from large platforms that
     51 using a git hosting platform does not. There are inconvenciences and
     52 disadvantages to self-hosting, but I think there are also advantages as well of
     53 a decentralized, self-hosted network of collaboration. Mygit is designed
     54 primraily for hobbyists or open source hosts, so it's easy to setup and
     55 maintain with little effort, rather than an unnecessarily piece of software
     56 like GitLab. The tradeoff is that you lose out on a lot of features.
     57 Self-hosting git isn't for everyone!
     58 
     59 ## Accepting patches
     60 The simplest way to accept patches when self-hosting Git is through
     61 [git-send-email](https://git-scm.com/docs/git-send-email)
     62 ([guide](https://git-send-email.io/)). You can accept patches either to your
     63 personal email or use a mailing list. Basically only obsessive ideologues like
     64 myself still use git-send-email these days, so you will probably lose
     65 contributers, and not being on GitHub means you lose a lot of discoverability,
     66 so make sure that you're willing to accept that when self-hosting git. You can
     67 mitigate these issues by mirroring to GitHub, but that kind of defeats the
     68 purpose of self-hosting.
     69 
     70 I am working on a sibling project to this that handles mailing list archives
     71 for exactly this purpose, but it is not ready for the public yet.
     72 
     73 ## Contributing
     74 * [ticket tracker](https://todo.sr.ht/~aw/mygit)
     75 * [patches](https://lists.sr.ht/~aw/patches)
     76 
     77 This exists on GitHub solely for visibility sake, and probably won't forever,
     78 but while it's here feel free to use GitHub issues, etc. This is alpha
     79 software, please report any bugs, etc!