After googling “hosting a git server”, I chose linuxfoundation's blog post as a guide, but as per my usual skepticism, ignored such headscratching suggestions as `git remote add origin ssh://git@remote-server/repo-<wbr< a="">>path-on-server.git`
(sic) (what does that even mean?) and simplified the instructions. In the following steps, I will show my server name as `githost`, easily set using an entry in /etc/hosts or ~/.ssh/config, and my own username as `me`.
First, as root on githost:
apt install git-core
adduser git
usermod -L git
cp -r ~me/.ssh ~git/
chown -R git:git ~git/
rm ~git/.ssh/id_rsa*
Then, logging out of the server, back on my own machine:
ssh git@githost
mkdir -p jcomeauictx/lzw
cd jcomeauictx/lzw
git init —bare
Logging out again, back in my own /usr/src/jcomeauictx/lzw repository:
git add remote githost git@githost:jcomeauictx/lzw
git push githost master
Done. Now I can push to github.com and to my own githost with the same syntax and directory structure. I can’t, of course, safely have other users on my server with this barebones method, but since none of my projects have active contributors besides me as yet, this is good enough for now.