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

FIX/COMMENT: git remote manual page

From
MBMichel Briand <michelbriand@free.fr>
Date
Dec 22, 2010, 01:15 UTC
Message-ID
<20101222021546.4b24c4e9@eana.kheb.homelinux.org>
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).
It fails at the last command :
    fatal: <my name> - not something we can merge
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.

I suspect the first error message is related to the remote name. And the second to the work tree not being the current directory.

Cheers, Michel

Next: Nguyen Thai Ngoc Duy
Message 1 of 4 in “FIX/COMMENT: git remote manual page”
  1. Michel BriandDec 22, 2010
  2. Nguyen Thai Ngoc DuyDec 25, 2010
  3. Michel BriandDec 25, 2010
  4. Nguyen Thai Ngoc DuyDec 25, 2010

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.