File protocol in GIT


I have run into a problem when I tried to add submodule into my project that is controlled by GIT. I got an error:

% git submodule add /submodule /project/submodule

fatal: transport 'file' not allowed
fatal: clone of '/submodule' into submodule path '/project/submodule' failed

The solution of this error is setting the global value always for file protocol in GIT like this:

git config --global protocol.file.allow always

That’s it!

How to delete zero byte files in your folders

It is easy peasy like this:

find . -type f -name "*.php" -size 0 -print0 | xargs -0 rm

And that’s all!