git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Greg Anders <greg@gpanders.com>
To: git@vger.kernel.org
Subject: git-shell default working directory
Date: Tue, 25 Feb 2020 17:48:30 -0700	[thread overview]
Message-ID: <20200226004830.oxd5562v7qqspnkk@Kepler> (raw)

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

             reply	other threads:[~2020-02-26  0:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26  0:48 Greg Anders [this message]
2020-02-26  9:10 ` git-shell default working directory 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200226004830.oxd5562v7qqspnkk@Kepler \
    --to=greg@gpanders.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).