Re: [RFC] introduce GIT_WORK_DIR environment variable

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

 



On Sunday 2007, March 11, Junio C Hamano wrote:

> What's the real motivation behind all this?

Coincidentally, I found I was needing this feature just yesterday.

I wanted to keep random configuration files in a repository.  I didn't 
want the directory structure though.  The config files are, of course, 
in my home directory, however I didn't want the danger of putting 
a .git that low in my hierarchy.  Having a .git that is findable from 
any location in my tree seems a bad idea.

So; I put the repository somewhere else and set GIT_DIR.  However that 
scuppered my plans.  Trying to add a config file results in "not in a 
working directory" (of course), because even though git can find the 
repository, it has no way of knowing which directory to consider as the 
root of the working tree.

Let me put this in command form for you:

 $ cd $HOME
 $ export GIT_DIR=$HOME/gitrepos
 $ git init
 $ git add .bashrc
 fatal: add must be run in a work tree

Being able to set GIT_WORKING_DIR would have let me do this.



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@xxxxxxxxx
-
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]