threads / discuss / 23177

Reuse .git directory.

Subject: Reuse .git directory.

## tl;dr

3 messages between Mar 25, 2010 and Mar 25, 2010.

replies: 2people: 3as markdown or json

Mahesh Vaidya· Mar 25, 2010, 17:50 UTC · lore
Reuse .git directory.
I would like work 4 different branch simultaneously viz.
master, feature, bugfix, expt but would like to use same same GIT_DIR. Is this possible ? so that I can save some space ?
I have tried following 
* git clone /path/to/repos
* export GIT_DIR=/path/to/repos/.git
* mkdir ~/feature
* git checkout -b feature master
This step misses the files. Please advise me if such an approach is correct ?
Thx
Mahesh
Ramkumar Ramachandra· Mar 25, 2010, 17:58 UTC · re: Mahesh Vaidya · lore

Re: Reuse .git directory.

Hi,
> I would like work 4 different branch simultaneously viz.
> master, feature, bugfix, expt but would like to use same same GIT_DIR. Is this possible ? so that I can save some space ?

All Git branches *are* contained in the same GIT_DIR. I'm not sure what your question is, but I suspect you don't understand how branching works in Git. Please read up some introductory material on this.

-- Ram

← back to recent threads