DEV Community

Gobinath Mallaiyan
Gobinath Mallaiyan

Posted on • Originally published at Medium on

Fixing a shallow GIT repo 💻

Photo by [Yancy Min](https://unsplash.com/@yancymin?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral)

Sometimes, a developer might intentionally (or) unintentionally end up with a shallow GIT Repo. And this can be a pain for those who unintentionally end up with shallow Repo.

You need to unshallow your local Repo. Following these simple steps can help you out of this situation.

Step 1: You must update/fix your origin remote repo.

git remote add origin <path-to-old-remote>

Step 2: You would need to perform a git fetch with an unlike option (as suggested below)

git fetch — unshallow origin

Just these two steps would restore your repo to the normal state. After this, you can perform all options, like push into your new remote repository.

Initially, this was posted as a GIST @ https://gist.github.com/gobinathm/96e27a588bb447154604963e09c38ddc

Top comments (0)