git checkout fast

C++
git clone [remote-url] --branch [name] --single-branch [folder]
Source

Also in C++: