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
You can symlink (or use junction points) the .git dir to a different location:
$ cd my/project
$ mv .git /over/here/.git
ln -s /over/here/.git .
And the repository will work fine.
Or you can replace the .git folder with a file that tells git where the .git folder really is. This is exactly how git submodules are setup by default in version 1.7.8 or later.
The steps to re-configure an existing checkout are:
.git containing: gitdir: path/to/.gitcore.worktree to point at the working copyAs a script that would be:
$ cd my/project
$ mv .git /tmp/.git
$ echo "gitdir: /tmp/.git" > .git
$ git config core.worktree $PWD
Easily create junctions on Windows using junction.exe from Microsoft.
> junction.exe c:\fast-ssd\proj\.git d:\slow-hdd\proj\.git