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

Re: Having Git follow symlinks

From
MRMatthew Ruffalo <mmr15@case.edu>
Date
Jan 31, 2014, 13:20 UTC
Message-ID
<52EBA304.3000205@case.edu>
In-Reply-To
<alpine.DEB.2.00.1401311052370.3993@ds9.cixit.se>
On 01/31/2014 04:56 AM, Peter Krefting wrote:
Show 19 quoted lines
> Matthieu Moy:
>
>> One option is to have the symlink in the other direction: make
>> /etc/foo a symlink to $GIT_WORKTREE/foo and version the later.
>
> I do that for the software that supports it, but ssh, for instance, is
> very picky that ~/.ssh is a directory and such. And at least one of
> the other files I version-control will be unlinked and overwritten in
> such a way that that does not work.
>
> I could split the repo up (that seems to be what "vcsh" is doing) and
> check the parts out in the corresponding directories, but I do like
> the idea of having one single repo.
>
>
> Oh, well, if I have the time, maybe I can come up with a patch. There
> is already some hacks in the "core.symlinks" setting, so I guess it
> should be possible.
>

This is now unrelated to Git, but I have .ssh symlinked to a version-controlled directory on all of my machines (Kubuntu 13.10, 14.04, and recent Gentoo systems, but I've also done this on CentOS 5 and 6).

SSH doesn't care whether ~/.ssh is a symlink, but it *does* //care about permissions:

""" mruffalo@giygas:~$ ls -ld .ssh lrwxrwxrwx 1 mruffalo mruffalo 13 Mar 17 2013 .ssh -> .home-git/ssh mruffalo@giygas:~$ ls -ld .home-git drwx------ 1 mruffalo mruffalo 116 Dec 8 01:26 .home-git """

If .home-git is mode 0755, SSH may refuse to use any private keys that it finds, though I was unable to reproduce this with a few quick tests.

MMR...
Previous: Peter KreftingNext: Junio C Hamano
Message 7 of 9 in “Having Git follow symlinks”
  1. Peter KreftingJan 28, 2014
  2. Johan HerlandJan 28, 2014
  3. Peter KreftingJan 30, 2014
  4. Christian CouderJan 30, 2014
  5. Matthieu MoyJan 30, 2014
  6. Peter KreftingJan 31, 2014
  7. Matthew RuffaloJan 31, 2014
  8. Junio C HamanoJan 31, 2014
  9. Matthieu MoyJan 31, 2014

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.