git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-shell default working directory

From
Andrei Rybak <rybak.a.v@gmail.com>
Date
Feb 26, 2020, 09:10 UTC
Message-ID
<241ea912-44b2-96fa-6f9a-3f04d5386b05@gmail.com>
In-Reply-To
<20200226004830.oxd5562v7qqspnkk@Kepler>
On 2020-02-26 01:48, Greg Anders wrote:
> Hello,
Hi Greg,
Show 12 quoted lines
> 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.
Disclaimer: I'm not at all familiar with git server setup. Would it make sense
to change git user home directory to be the required dedicated directory?
Show 11 quoted lines
> 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 
Previous: Greg AndersNext: Jeff King
Message 2 of 7 in “git-shell default working directory”
  1. Greg AndersFeb 26, 2020
  2. Andrei RybakFeb 26, 2020
  3. Jeff KingFeb 26, 2020
  4. Junio C HamanoFeb 26, 2020
  5. Jeff KingFeb 26, 2020
  6. Greg AndersFeb 27, 2020
  7. Greg AndersFeb 28, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.