Search code examples
gitsmartgit

How to set --work-tree or --git-dir in 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?


Solution

  • 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