shared git repo + ssh = umask problems

Posted by Moser on 19 Dec 2008

When you want to share a little git repository on your own server the first thing that comes to your mind is SSH. It’s installed virtually everywhere, secure and easy to configure. In the beginning there are no problems, because everyone can clone your repo and if they don’t change files concurrently even pushing works. About one day latter you get umask problems and start to search the web for solutions. To make it short, here it is:

git repo-config core.sharedRepository true

This option makes git care about the permission stuff. I wasted about 10 hours of my lifetime for this one and found an odd thing about ~/.ssh/rc:

umask 002
date > ~/sshrc-executed

I added the second line, because I wasn’t sure if it was executed. It was (look at the file permissions):

-rw-rw-r--  1 moser git     29 Dec 19 18:41 sshrc-executed

But my umask didn’t last:

moser@HellAgent:~$ ssh -n 'umask'

Don’t know why, if anyone knows tell me please.