91

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.

Freewind
  • 193,756
  • 157
  • 432
  • 708
  • I'm pretty sure there's no way to go from this repo to the full version - you will most likely need to clone the entire repo, including the latest revision, into a fresh copy in order to have the full history. I'm not 100% sure that this is the case, however, so I will leave it to somebody with more knowledge in this area to provide a more definitive answer for you. – JamesG Mar 26 '15 at 02:33
  • 5
    possible duplicate of [Convert shallow clone to full clone](http://stackoverflow.com/questions/6802145/convert-shallow-clone-to-full-clone) – Makoto Mar 26 '15 at 02:34

2 Answers2

143

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

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
19

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

Won Jun Bae
  • 5,140
  • 6
  • 43
  • 49