Reputation: 12557
Within a locally cloned git repository I can watch the history with
git log
In a small tool I only need the history of a repository, not the code. Is there a way to clone a repository without the code (history only)?
Is there any other way to get the history only from a git repository?
Upvotes: 19
Views: 11209
Reputation: 86
Combining the --bare
and --filter=blob:none
options on clone gives you the full logs while omitting the objects thus minimizing space for commit history:
git clone --bare --filter=blob:none ...
Upvotes: 6
Reputation: 1978
If you only want to view the history, you can use the partial clone feature with filtering out the blobs(file contents).
git clone --filter=blob:none YOUR_GIT_URL
Ref:
Upvotes: 2
Reputation: 11855
Clone the repository with the --bare
flag:
git clone --bare ...
A "bare" repository in Git just contains the version control information and no working files (no tree) and it doesn't contain the special .git sub-directory. Instead, it contains all the contents of the .git sub-directory directly in the main directory itself.
Read more in the documentation on it, or this helpfull page about setting up server environments using the option.
Upvotes: 16