0 votes
1 view
in DevOps and Agile by (20k points)

The central repository had to be set up on a new server, so I created a new remote on my local repository and pushed to that.

But now when I do git pull, it claims I am up to date. It's wrong—it's telling me about the old remote branch, not the new one, which I know for a fact has new commits to fetch.

How do I change my local branch to track a different remote?

I can see this in the git config file but I don't want to mess things up.

[branch "master"]

    remote = oldserver

    merge = refs/heads/master

1 Answer

0 votes
by (28.4k points)

The following command should work: 

$ git remote set-url origin https://some_url/some_repo

Don't forget to push: 

$ git push

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...