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