Search code examples
gitgit-branch

Delete git branches on server


how can I delete this two branches:

  • remotes/main/main
  • remotes/main/HEAD

CMD result of git branch -vaa

The remotes/origin/... branches are correct.

I tried:

git push origin -d main/main -> error: unable to delete 'main/main': remote ref does not exist

git push main -d main -> fatal: 'main' does not appear to be a git repository fatal: Could not read from remote repository.

but nothing works.


Solution

  • Does the branch actually exist on the remote or are you just trying to delete the local reference?

    To delete the local reference:

    git branch -rd main/main