Re: Bug? clone ignores --git-dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jack Bates <bk874k@xxxxxxxxxxxxxxxx> writes:

> ... repositories, however `clone` ignores `--git-dir`:

An intentional design decision (and it may be an unfortunate one by
now [*1*]) was to have the GIT_DIR (hence --git-dir) talk about the
*source side* of the clone, not the destination, e.g.

	cd /home/me/working/tree
	export GIT_DIR=/home/me/repo/sitory
	export GIT_WORK_TREE=$(pwd)

	# the above told Git that /home/me/working/tree has a
	# checkout but its repository body is not anywhere in its
	# subdirectory -- it is /home/me/repo/sitory.

	# now we clone the repository we are currently working on
	# without GIT_DIR applying to the source side, it won't
	# work.
	git clone . /else/where

And we cannot allow /home/me/repo/sitory (i.e. GIT_DIR for the
source repository) become the GIT_DIR for the resulting /else/where
repository (you'd be cloning to yourself).


[Footnote]

*1* with use of "git worktree" gaining traction, perhaps the need to
    create local clone out of the shared/same GIT_DIR may have
    diminished.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux