Re: Need to set GIT_WORK_TREE when setting GIT_DIR !?

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

 



2012/3/10 Frédéric Heitzmann <frederic.heitzmann@xxxxxxxxx>:
> However man git-config says :
>
> "If --git-dir or GIT_DIR is specified but none of --work-tree, GIT_WORK_TREE
> and core.worktree is specified, the
> current working directory is regarded as the top level of your working
> tree."
>
> Some more context on my precise problem :
> I have a project, with source files managed with git.
> I also use some Makefiles that I would like to manage with git _in a
> separate repository_
>
> $ GIT_DIR=<project_path>/.git git add some_file.c ...
> $ GIT_DIR=<project_path>/.git_mk git add Makefile ...
>
> Setting worktree in each GIT_DIR/config will fix that but I can't figure out
> why current git implementation actually needs this.

Historical reason: before separate worktree feature was introduced,
git assumed worktree was at $GIT_DIR's parent directory. Old scripts
may rely on that behavior.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]