Select Page

This issue comes with cloning a project with Shallow Clone and you want to push your codes to github.

What is shallow clone?

Shallow clone is just cloning a repository using --depth.
If you use Shallow clone to your local machine, it will not allow you to push your codes to your remote origin. You have to remove the shallow clone record to push your codes to remote repository.

How to remove shallow clone?

Here is a simple solution for this:

git fetch --unshallow

Now do your regular work, if you still have not set your new remote url, set it before to push

git remote remove origin
git init
git remote add origin
git push origin master

Change the branch name if you need. Set upstream as your own.

Go back to Tradecoder Dev Solution

Read more on Git- Github

If you find this information helpful, please feel free to share it