git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Michel Briand <michelbriand@free.fr>
Cc: git@vger.kernel.org
Subject: Re: FIX/COMMENT: git remote manual page
Date: Sat, 25 Dec 2010 17:48:58 +0700	[thread overview]
Message-ID: <AANLkTim_pHYEZ+7-Rm5N4Ycw2MTHD8AhvZrZqNhttkck@mail.gmail.com> (raw)
In-Reply-To: <20101222021546.4b24c4e9@eana.kheb.homelinux.org>

On Wed, Dec 22, 2010 at 8:15 AM, Michel Briand <michelbriand@free.fr> wrote:
> Hello,
>
> I tried the example given at the bottom if the manual page of git
> remote.
>
> ·   Imitate git clone but track only selected branches
>
> $ mkdir project.git
> $ cd project.git
> $ git init
> $ git remote add -f -t master -m master origin git://example.com/git.git/
> $ git merge origin
>
> It works like it is written.
>
> But it seems this does not work with my special setup:
> - I use GIT_DIR and GIT_WORK_TREE to specify another location for my
>  repository, and to work from another directory,
> - I name my remote with a custom name (not origin).

So you set GIT_DIR and GIT_WORK_TREE before running "git remote add"?

> It fails at the last command :
>
>    fatal: <my name> - not something we can merge

It fails to see "<my name>" points to a commit. Maybe it fails to read
remote information from config..

> But if I try the command :
>
>    git merge <my name>/master
>
> the error message is different :
>
>    fatal: This operation must be run in a work tree
>    fatal: read-tree failed
>
> I cd to the work tree and issue the same last command.
> Then it works.

What git version are use using? I did

GIT_DIR=git/.git GIT_WORK_TREE=git git/git merge origin # or a specific branch

and it worked fine here (recent master). That message means work-tree
settings are not propagated to git-read-tree (run by git-merge).
-- 
Duy

  reply	other threads:[~2010-12-25 11:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22  1:15 FIX/COMMENT: git remote manual page Michel Briand
2010-12-25 10:48 ` Nguyen Thai Ngoc Duy [this message]
2010-12-25 11:41   ` Michel Briand
2010-12-25 13:00     ` Nguyen Thai Ngoc Duy

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=AANLkTim_pHYEZ+7-Rm5N4Ycw2MTHD8AhvZrZqNhttkck@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=michelbriand@free.fr \
    /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).