Is it possible to clone a git repository without fetching entire history?
Yes, it is possible with providing --depth
option to git
command as below:
$ git clone --depth 1 [email protected]:torvalds/linux.git
If you choose 1 for the depth value, it will copy only the latest revision of everything in the repository.
In past, only disadvantages of this schema, if you clone the repository by this way, it is not possible to make new commits and push them into the repository again.
But git version 1.9 and above, this is not an issue anymore. You can clone a git repository with depth option and make new commits on it.