From: Rogan Dawes <lists@dawes.za.net>
To: Git Mailing List <git@vger.kernel.org>
Subject: Re: Git doesn't like symlinks?
Date: Wed, 08 Aug 2007 10:29:57 +0200 [thread overview]
Message-ID: <46B97F05.6060503@dawes.za.net> (raw)
In-Reply-To: <46A09A2B.3030205@dawes.za.net>
Rogan Dawes wrote:
> Hi folks,
>
> I have been tasked with doing some development against an external SVN
> repo, and keeping it largely in sync with an internal directory.
>
> Seeing as how this is a git list, I obviously decided to do this using
> git :-)
>
> So, I have a local git repo with my local changes from the SVN repo, and
> I can push them to the SVN repo without too many problems. The problem
> arises when I try to sync with the local directory.
>
> Since the local directory's structure doesn't match the repo exactly, I
> figured I could work around that by using a symlink to get to the right
> place.
>
> ie. the local dir is
> C:\local\blah\release\5.2\<contents>
>
> and the structure of the SVN (and hence git) repo is:
> /top/main/<contents>
>
> where <contents> is/should be identical between the two places.
>
> Obviously, git won't work correctly in the local dir, so I tried the
> following (on Cygwin)
>
> $ cd /tmp
> $ ~/git/contrib/workdir/git-new-workdir /my/git/repo/ repo-local
> $ cd repo-local/top
> $ rm -rf main/
> $ ln -s /c/local/blah/release/5.2/ main/
> $ git status
>
> This worked, and showed me that there were a few files out of sync.
>
> I decided to copy over one of the files from git to the local dir:
>
> $ git checkout top/main/some/file
>
> And git deleted my "main" symlink, and replaced it with a real dir,
> containing "some/file".
>
> Everything _else_ was now "missing".
>
> Any ideas on how I can get this to work? I know this is not strictly
> what git was designed for, but it could do a really good job if it would
> only leave my symlink alone.
>
> Rogan
So, for anyone else caught in this awkward position, the answer is not
to use a symlink, but to use cygwin's mount command instead.
$ cd /tmp
$ ~/git/contrib/workdir/git-new-workdir /my/git/repo/ repo-local
$ cd repo-local/top
$ rm -rf main/
$ mkdir main/
$ mount 'C:\local\blah\release\5.2\' /tmp/repo-local/top/main/
And everything works as expected.
Regards,
Rogan
prev parent reply other threads:[~2007-08-08 8:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-20 11:19 Git doesn't like symlinks? Rogan Dawes
2007-08-08 8:29 ` Rogan Dawes [this message]
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=46B97F05.6060503@dawes.za.net \
--to=lists@dawes.za.net \
--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.
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).