I want compress all the git repositories on my computer (say in ~
). I.e., for each directory {}
, that contains directory or file (in case of submodules) named .git
, I want to execute git gc --aggressive --git-dir={}
.
I tried the following:
/bin/find /c/libs/boost/ -name '.git' -print -exec git --git-dir=dirname {} gc --aggressive \;
but output consist of plenty of fatal: Not a git repository: 'dirname /c/libs/boost/.git'
etc. What should I do to use dirname
command correctly? Or something else to achieve desired effect?
bash -c ""
with\$\(dirname {}\)
and`dirname {}`
, but without any positive effect.