2 ms·
I use a separate work folder. Like this: git --git-dir=/foo/bar.git --work-tree=/foo/bar.work init git --git-dir=/foo/bar.git config receive.denyCurrentB
by InclinedPlane 11y ago
I use a separate work folder.
Like this:
git --git-dir=/foo/bar.git --work-tree=/foo/bar.work init
git --git-dir=/foo/bar.git config receive.denyCurrentBranch ignore
Then create (and chmod +x): /foo/bar.git/hooks/post-update
#!/bin/sh
work_tree=/foo/bar.work
GIT_WORK_TREE=$work_tree git checkout -f
Then you just create a symlink to the work tree for your website root, or put the work tree there, or whatever, depending on preference. Can't say this is perfect, but it works pretty well for smaller projects.