We use git to distribute an operating system and keep it upto date. We can\'t distribute the full repository since it\'s too large (>2GB), so we have been using shallow clon
Just did g clone github.com:torvalds/linux and it took so much time, so I just skipped it by CTRL+C.
Then did g clone github.com:torvalds/linux --depth 1 and it did cloned quite fast. And I have only one commit in git log.
So clone --depth 1 should work. If you need to update existing repository, you should use git fetch origin remoteBranch:localBranch --depth 1. It works too, it fetches only one commit.
Summing up:
Initial clone:
git clone git_url --depth 1
Code update
git fetch origin remoteBranch:localBranch --depth 1