Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set --work-tree or --git-dir in smartgit?

Tags:

git

smartgit

Smartgit creates .git directory in work-tree directory. I want to locate .git directory out of my work-tree directory, how to do it?

like image 950
Ildar Avatar asked Oct 06 '22 09:10

Ildar


1 Answers

After creating or cloning your repository, you can move the .git-directory structure to somewhere else and instead add a .git-file which points to that location. E.g. if you have git-test-wt and git-test-repo stored side-by-side on your disk, create git-test-wt/.git-file with following content:

gitdir: ../git-test-repo
like image 88
mstrap Avatar answered Oct 10 '22 21:10

mstrap