7

is there any way to fetch only history? Sometimes repositories are big and it takes very long period of time to download it.

I don't need a files, i just need to look for commits history with git log and git show.

2
  • What do you mean by "fetch only commits history"? How is this different from what Git does by default? (Consider: If you can look at a repository's history you have the contents of every revision.) Commented Dec 17, 2016 at 14:17
  • Does this answer your question? Is there a way to git fetch and only get the history - no files Commented May 15, 2024 at 21:31

2 Answers 2

3

No you can't.

In Git repositories, commits and files are managed separately. So it should be possible to implement a feature to fetch only commits, but such a feature is not implemented yet.

Note that a commit in a repository includes only information git show -q <commit> shows. So, if such a feature would be implemented, you can't see diffs or so in a repository fetched by the feature.

Sign up to request clarification or add additional context in comments.

Comments

2

No if you want to see all the history locally, you will need to clone all changes.
You just can do so in a bare repo (git clone --bare) in order to not checkout the default branch HEAD.

But that won't mean downloading less data: only a shallow clone would download less, but that would mean a partial history.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.