I have my source code and .git folder on a small fast ssd, I would like to have the .git directory on my second bigger slower hdd and keep my working code on my fast smaller
The --separate-git-dir method is exactly the same as the gitdir approach.
--separate-git-dir
gitdir
After running
$ git init --separate-git-dir=[path to directory for .git data]
what happens is that a .git file is created in the local directory with the following content:
.git
gitdir: [path to directory for .git data]