Have you ever wanted to have a git server on a raspberry pi? Having a git server is not that complicated. I tried GitLab, Gogs, and Gitea. They are excellent, but for my hobbies, I asked myself what the minimal way to have a git server on a raspberry pi is.
Gogs works well; a long time ago, when I tried, I just needed to remember to use port 2222 instead of 22, and that is where everything went wrong for me because, after six months of no usage, I just remembered about the port difference.
Let's start simple and leave the ssh for the next time.
You could, for an unknown reason, have your repo on the same machine, and to do that, follow this:
cd
mkdir -p repositories/test
cd ~/repositories/test
git init --bare
And then you can try your new repo on the Desktop like this:
cd
cd Desktop
git clone ~/repositories/test
cd test
touch README.md
git add .
git commit -m "initial commit"
git push
From this moment, you could treat ~repositories/test as any remote git repo. This one is the hello world of the git servers. And it seems not functional, but the next step is to do the git init bare on a raspberry pi and use the same concept used here but plus ssh.
Minor note: You can not use commit or make changes to a bare repository. Leave it alone and only work with the cloned one.
~/repositories/test will be the origin for ~/Desktop/test, which is the place where you clone your bare repository.
Let's leave this for another day.