Is it possible to run automatically a .bash script after running
git clone ..repo..
rm -rf .git
mkdir ~/global_hooks #create and edit the post-checkout inside echo '#!/bin/bash' >> ~/global_hooks/post-checkout echo 'rm -rf .git' >> ~/global_hooks/post-checkout #... chmod 755 ~/global_hooks/post-checkout git config --global core.hooksPath ~/global_hooks/
Any new clone with a checkout (without
--bare) will trigger
.git will be removed. But this is not a good idea because you'll have to enable and disable the hook for different clones. Besides, every user needs to make the configuration, so it's a bit annoying.
What's worse, a git-checkout in a repository without disabling or overriding the global hook will remove its
.git. So this is just for fun but not practical at all.