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

`.git` symlink makes `git submodule add` fail

From
Vít Novotný <witiko@gmail.com>
Date
Feb 12, 2016, 16:48 UTC
Message-ID
<20160212164853.GA6888@witiko>
Hi,
	$ uname -a
	Linux witiko 4.3.0-1-amd64 #1 SMP Debian 4.3.5-1 (2016-02-06) x86_64 GNU/Linux
	$ git --version
	git version 2.7.0

I tend to make `.git` a symlink, when I need to maintain several Git repositories inside a single directory. This was always transparent to Git, but problems arose, when working with submodules:

	$ mkdir -p .repos/repoA
	$ ln -s .repos/repoA .git
	$ git init
	Initialized empty Git repository in /tmp/tmp.q3hkme6nm4/.repos/repoA/
	$ git submodule add https://github.com/witiko/git-parallel
	Cloning into 'git-parallel'...
	remote: Counting objects: 212, done.
	remote: Compressing objects: 100% (16/16), done.
	remote: Total 212 (delta 6), reused 1 (delta 1), pack-reused 195
	Receiving objects: 100% (212/212), 64.20 KiB | 0 bytes/s, done.
	Resolving deltas: 100% (120/120), done.
	Checking connectivity... done.
	fatal: Could not chdir to '../../../git-parallel': No such file or directory
	Unable to checkout submodule 'git-parallel'
Is this a bug, or is the ability to symlink `.git` just a happy coincidence?

Best Regards, Vít

Next: Junio C Hamano
Message 1 of 7 in “`.git` symlink makes `git submodule add` fail”
  1. Vít NovotnýFeb 12, 2016
  2. Junio C HamanoFeb 12, 2016
  3. Junio C HamanoFeb 12, 2016
  4. Jeff KingFeb 12, 2016
  5. Vít NovotnýFeb 13, 2016
  6. Jeff KingFeb 13, 2016
  7. Vít NovotnýFeb 12, 2016

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.