You have cloned a repo maybe using shallow clone with git clone --depth <depth> <repo>
implies --single-branch
,
But strangely when you are trying to fetch from remote, it's not working.
To fix a local repo that's not fetching try:
or
git config remote.upstream.fetch "+refs/heads/*:refs/remotes/upstream/*"
git config --get remote.upstream.fetch
git fetch
To prevent this from happening in the future, As noted in the man page git-clone(1), so we'd better do it with git clone --depth <depth> --no-single-branch <repo>
.
Reference: Stackoverflow