how to checkout branch from shallow clone git code example Example: shallow clone specific branch git clone --depth 1 https://path/to/repo/foo.git -b bar