0

I have a repo that had a wrong remote name, and the remote branch somehow deleted.

I updated the remote to be named 'origin' .. but the local branch still seems to reference the previous remote name "staging" .. so looks as if tracks the wrong remote. The remote was the same URL, just changed the name.

Pushing to and pulling from the remote works, but 'git status' shows it tracking a now non-existent remote "staging"

user@kv2:/var/www/web/reponame.org (staging)$ git checkout staging
Already on 'staging'
Your branch is up to date with 'staging/staging'.
user@kv2:/var/www/web/reponame.org (staging)$ git remote -v
origin  ssh://git@servername.com/Group/reponame.org-d9.git (fetch)
origin  ssh://git@servername.com/Group/reponame.org-d9.git (push)

I'm tried various commands, but I can't seem to make it recognize that it tracks the remote "origin" branch "staging" for the "staging" branch on the local.

How to right this?

  • 1
    Does this answer your question? [Make an existing Git branch track a remote branch?](https://stackoverflow.com/questions/520650/make-an-existing-git-branch-track-a-remote-branch) – JDB Apr 20 '23 at 19:15

0 Answers0