I would like to run on my server a git server in order to use the software
password-store on android and
pass on iOS). That's all I need the git server for, so it should be as lightweight and safe as possible.
If you would like to self-host a git server, then I would recommend you to purchase Atlassian Bitbucket server for small cost ($ 10 per Year).
Go to "https://www.atlassian.com/software/bitbucket/pricing?tab=self-hosted" and click "Looking for Server pricing". Choose your Bitbucket user tier for 10 users.
I would simply setup an SSH server. On a Debian install, you would:
apt-get install openssh-server git
Then setup a bare git repository in your home:
umask 077 git init --bare pass.git
Then you can add this as a remote to your pass repository with a simple:
pass git remote add origin yourserver.example.com:pass.git pass git push -u origin master
Now of course, I assume you know how to put that server online on a public IP, which I consider out of scope for this question.