support git's shallow clone

Can save bandwith, diskspace, resource usage and time when the git repository is large, and we don't want to clone the whole repository.