git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-shell default working directory
@ 2020-02-26  0:48 Greg Anders
  2020-02-26  9:10 ` Andrei Rybak
  0 siblings, 1 reply; 7+ messages in thread
From: Greg Anders @ 2020-02-26  0:48 UTC (permalink / raw)
  To: git

Hello,

I'm working on standing up a self-hosted git server. I'd like to keep my 
repositories under a dedicated directory, i.e. /srv/git, but I'd also 
like to be able to clone a repository using a simple syntax:

     git clone git@myserver:repo.git

as opposed to

     git clone git@myserver:/srv/git/repo.git

I've not yet found a way to get this to work without keeping the 
repositories in the git user's home folder. I've tried using a ~/.ssh/rc 
file to chdir into /srv/git and I've tried using the `command=` 
parameter in the authorized_keys file; however, both of these fail 
because `cd` is not recognized as a valid command by git-shell.

I suppose I could create symlinks from the repositories in /srv/git into 
/home/git, but I'm wondering if there's a cleaner way to do this?

Thanks,

Greg

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-02-28 20:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-26  0:48 git-shell default working directory Greg Anders
2020-02-26  9:10 ` Andrei Rybak
2020-02-26 20:11   ` Jeff King
2020-02-26 20:29     ` Junio C Hamano
2020-02-26 20:39       ` Jeff King
2020-02-27 21:57         ` Greg Anders
2020-02-28 20:40           ` Greg Anders

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).