I’ve been recently dabbling on rust, and I am have been mostly doing that on my laptop. However, I also have a desktop and once in a while I would like to resume my stuff from the laptop, but without manual file transfers.
I know git by design does this, but I would like to use my current docker setup with Ubuntu server to have a very simple git server.
What would be the simplest git server to have in this situation? Keep in mind I am not planning to expose none of this to the internet
I use forgejo on a raspberry pi.
Second Forgejo. Easiest deploy I’ve ever done.
The really simple setup for a single user is just a SSH server with access to storage and the git command. Assuming your laptop and desktop have SSH access to
server
, you can just:ssh server git init --bare somerepo cd somerepo git remote add server server:somerepo git push --set-upstream somerepo master #(or main)
and then
git clone server:somerepo
.For something slightly higher-tech, I recommend going with Forgejo (the fork of Gitea). It is really easy to set up and low maintainance.
Avoid GitLab for small setups, it is fairly resource hungry.
This is the correct answer
For something more than bare got and lower than forgejo I can recommend soft-serve
- Install Rocky9
- Yum install gitlab-omnibus
- Oh. We’re done.
Many excellent replies. Just want to add https://github.com/charmbracelet/soft-serve as an option
git init --bare
And then just ssh to the server to push/pull. It can’t be any simpler
Check out Gitea. It was pretty easy to set up with docker and they have pretty decent docs.
The simplest (really the simplest) would be to do a
git init --bare
in a directory on one machine, and that way you can clone, push or pull from it, with the directory path as URL from the same machine and using ssh from the other (you could do this bare repo inside a container but really would be complicating it), you would have to init a new bare repo per project in a new directory.If a self-hosted server meaning something with a web UI to handle multiple repositories with pull requests, issues, etc. like your own local Github/Gitlab. The answer is forgejo (this link has the instructions to deploy with docker), and if you want to see how that looks like there is an online public instance called codeberg where the forgejo code is hosted, alongside other projects.
If you fancy a nice webbased interface, Forgejo. Git bare with cgit is an option of course, but running the single application for Forgejo will you lots of fun.
I’ve played with Gitea a little and it was easy to set up, but I didn’t need the web stuff. So as others have suggested, I just set up a bare git repo in one place, then git clone it over ssh in the other place, and push and pull to it. So that’s an SVN-like model with a central repo, plus a few other places using it and sometimes pushing code to it that I manually pull when needed to the others.
All this stuff with docker containers seems like ridiculous overkill.
This is not the simplest answer at all but FYI you can also self host gitlab