Pushing to github after a shallow clone

前端 未结 5 919
春和景丽
春和景丽 2020-12-02 23:56

I had a massive git repo because of a huge number of commits, so following advice here I created a shallow clone. I\'ve made changes to this new local repo, and now I want t

5条回答
  •  一向
    一向 (楼主)
    2020-12-03 00:10

    Git (since 1.8.3) now has an official way to fetch the full history of a shallow clone:

    git fetch --unshallow
    

    From the git fetch documentation:

    --unshallow

    If the source repository is complete, convert a shallow repository to a complete one, removing all the limitations imposed by shallow repositories.

    If the source repository is shallow, fetch as much as possible so that the current repository has the same history as the source repository.

提交回复
热议问题