git pull displays "fatal: Couldn't find remote ref refs/heads/xxxx" and hangs up

Solution 1:

There are probably some commands to resolve it, but I would start by looking in your .git/config file for references to that branch, and removing them.

Solution 2:

You also have to delete the local branch:

git branch -d 6796

Another way is to prune all stale branches from your local repository. This will delete all local branches that already have been removed from the remote:

git remote prune origin --dry-run

Solution 3:

I just ran into a similar issue when I tried to commit to a newly created repo with a "." in it's name. I've seen several others have different issues with putting a "." in the repo name.

I just re-created the repo and

replaced "." with "-"

There may be other ways to resolve this, but this was a quick fix for me since it was a new repo.