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

Re: [Bug report] git fetch/push fails from sub-directory

From
FHFrederic Heitzmann <frederic.heitzmann@gmail.com>
Date
Sep 20, 2011, 22:25 UTC
Message-ID
<4E7912C9.7000908@gmail.com>
In-Reply-To
<7v62km6fjl.fsf@alter.siamese.dyndns.org>
Le 20/09/2011 23:59, Junio C Hamano a écrit :
Show 12 quoted lines
> Frederic Heitzmann<frederic.heitzmann@gmail.com>  writes:
>
>> I found a bug in git fetch, with local repositories.
>
>> cd repo2
>> git fetch ../repo1	# OK
>> cd d
>> git fetch ../../repo1	# failed
>
> It has always been like this.  You can give a full path to the repository
> from the root, or perhaps define a nickname to refer to the remote (see
> "git remote add") and use it instead.

Is it supposed to be normal ?! I mean : OK I can use git-remote, but this leads to differents results for similar usages and similar commands. Let's compare following cases :

_Case 1:_
|
|_repo1
|   |
|   \_dir
|
\_repo2
     |
     \_dir

cd repo2/dir git fetch ../../repo1 # FAILURE

_Case 2:_
|
|_repo1
|
\_temp
     |
     \_repo2

cd temp/repo2 git fetch ../../repo1 # SUCCESS

For sure, one can argue that I should better organize my file tree ;-)

-- Fred

Previous: Junio C Hamano
Message 3 of 3 in “[Bug report] git fetch/push fails from sub-directory”
  1. Frederic HeitzmannSep 20, 2011
  2. Junio C HamanoSep 20, 2011
  3. Frederic HeitzmannSep 20, 2011

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.