Skip to contentSkip to conversation

Reuse .git directory.

DISCUSSION Mahesh Vaidya 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

#2 lore raw
In reply to Mahesh Vaidya

Hi,

Quoted 2 lines

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