From: "Nguyen Thai Ngoc Duy" <pclouds@gmail.com>
To: geoffrey.russell@gmail.com
Cc: git@vger.kernel.org
Subject: Re: Moving .git around
Date: Thu, 24 Jul 2008 09:12:19 +0700 [thread overview]
Message-ID: <fcaeb9bf0807231912t6f20d508va1381f324a8981aa@mail.gmail.com> (raw)
In-Reply-To: <93c3eada0807231832o6b7689c4j2913253d7ced62ba@mail.gmail.com>
On 7/24/08, Geoff Russell <geoffrey.russell@gmail.com> wrote:
> For reasons which would take a while to explain, I'm building a repository
> in a directory using "--git-dir=xxxx/.git --work-tree=." and
> then doing an "mv xxxx/.git ./.git" and then trying to work with
> that repository --- but can't
>
> Below is a sample script. The last line (git add) fails with
>
> fatal: unable to create
> '/usr/local/AusTop/AuPrograms/AuServer/testgit/aaa/bbb/.git/index.lock':
> No such file or directory
>
> git doesn't seem to realise that there is a .git back up the tree.
It's because when you did git --work-tree=. init, worktree is stored
in .git/config. The code that chdir() in setup_git_directory()
probably forgot to chdir() back to toplevel worktree. Workaround could
be just remove core.worktree in .git/config.
> I'm using 1.5.5.1
>
> Cheers,
> Geoff Russell
>
> ------------------------ sample script
> #!/bin/sh
> if [ -d "testgit" ] ; then
> echo "remove testgit"
> /bin/rm -rf testgit
> fi
> mkdir testgit && echo yyyy >testgit/sample.sh && cd testgit
> mkdir aaa && mkdir aaa/bbb
> echo xxxx > aaa/bbb/sample2.sh
> mkdir xxx
> git --git-dir=xxx/.git --work-tree=. init
> git --git-dir=xxx/.git --work-tree=. add *.sh
> git --git-dir=xxx/.git --work-tree=. commit -m demo
> mv xxx/.git .
> cd aaa/bbb
> git add sample2.sh
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Duy
next prev parent reply other threads:[~2008-07-24 2:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-24 1:32 Moving .git around Geoff Russell
2008-07-24 2:12 ` Nguyen Thai Ngoc Duy [this message]
2008-07-24 2:36 ` Geoff Russell
2008-08-03 18:51 ` Jan Hudec
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=fcaeb9bf0807231912t6f20d508va1381f324a8981aa@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=geoffrey.russell@gmail.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.
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).