From: Johan Herland <johan@herland.net>
To: Peter Krefting <peter@softwolves.pp.se>
Cc: Git mailing list <git@vger.kernel.org>
Subject: Re: Having Git follow symlinks
Date: Tue, 28 Jan 2014 15:47:14 +0100 [thread overview]
Message-ID: <CALKQrgf5o-ZcaeqXLm3P7RpK2yPcFd_HnG4ewwoEGESduyDSjQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1401281443330.17426@perkele.intern.softwolves.pp.se>
On Tue, Jan 28, 2014 at 2:49 PM, Peter Krefting <peter@softwolves.pp.se> wrote:
> Is there a (per-repo) setting to get Git to follow symlinks in the working
> directory, i.e., to not store the symlinks themselves but rather work on
> what they point to?
Not that I know of.
> Background: I have a repository that stores a number of my dotfiles, shared
> between all my machines (Linux, OSX, Windows/CygWin, Solaris). It is
> currently a CVS repo that I wish to convert to Git since CVS is getting more
> and more scarce. However, I have the repo set up so that I check it out into
> a subdirectory of its own, and have symlinks (junctions on Windows) both
> coming into it (for files that live in ~) and out of it (for subdirectories
> of ~ that cannot be symlinks themselves, such as ~/.ssh, or that live
> elsewhere, such as under AppData on Windows or ~/Library on MacOS). CVS
> handles this by simply not knowing anything about symlinks, and I would like
> to get Git to do the same.
I believe a preferable way to manage dotfiles in Git, is to have a
script that does the necessary setup/installation from the repo (that
lives in some subdirectory of ~) and into ~. This script would be able
to:
- Set up whatever symlinks or copies are needed
- Apply permission/mode bits that are not stored by Git
- Properly handle various platform differences (symlinks vs. junctions, etc.)
As a bonus, you can run the script as a post-checkout hook, to have it
automatically apply any updates you fetch/push into your dotfiles
repo.
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
next prev parent reply other threads:[~2014-01-28 14:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 13:49 Having Git follow symlinks Peter Krefting
2014-01-28 14:47 ` Johan Herland [this message]
2014-01-30 9:01 ` Peter Krefting
2014-01-30 10:09 ` Christian Couder
2014-01-30 12:37 ` Matthieu Moy
2014-01-31 9:56 ` Peter Krefting
2014-01-31 13:20 ` Matthew Ruffalo
2014-01-31 17:23 ` Junio C Hamano
2014-01-31 17:56 ` Matthieu Moy
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALKQrgf5o-ZcaeqXLm3P7RpK2yPcFd_HnG4ewwoEGESduyDSjQ@mail.gmail.com \
--to=johan@herland.net \
--cc=git@vger.kernel.org \
--cc=peter@softwolves.pp.se \
/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.
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).