How to fetch all git history after I clone the repo with `--depth 1`?

Git

Git Problem Overview


There is a big repo with thousands of commits. When I clone it, I just want to see the latest code, and don't wait for too long, so I run:

git clone git://..../... --depth 1

But later, I want to see all the history commits, but I don't know how to fetch all the histories.

Git Solutions


Solution 1 - Git

Use git pull --unshallow and it will download the entire commit history.

Solution 2 - Git

Alternatively, you can also run git fetch --depth=1000000.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFreewindView Question on Stackoverflow
Solution 1 - GitDaniel MannView Answer on Stackoverflow
Solution 2 - GitWon Jun BaeView Answer on Stackoverflow