1

This is a problem occurred in a GitHub corporate site. I had a repository in my account folder (unnnn/CCS_src1). Then I moved it to a group folder(app-FST/CCS_src1). Then I cloned it to my laptop. Everything went fine until I ran "git remote -v"

$ git remote -v
    origin  https://github.xxxx.com/app-FST/CCS_src1 (fetch)
    origin  https://github.xxxx.com/app-FST/CCS_src1 (push)
    origin  https://github.xxxx.com/unnnn/CCS_src1 (push)

There are two push destinations. How do I remove the destination https://github.xxxx.com/unnnn/CCS_src1?

Many thanks to your answer in advance.

Andrew K

acyk
  • 11
  • 1
  • 2
    Possible duplicate of [How to remove remote origin from Git repo](https://stackoverflow.com/questions/16330404/how-to-remove-remote-origin-from-git-repo) – C1sc0 Jun 12 '18 at 00:39
  • @9301293 I tried "git remote remove origin". It threw an error: Could not remove config section 'remote.origin' – acyk Jun 12 '18 at 17:04
  • Edit your git config file manually. – C1sc0 Jun 13 '18 at 00:27

1 Answers1

2

I think in your case the simplest thing might be

git remote remove origin && git remote add  origin  https://github.xxxx.com/app-FST/CCS_src1

This will require you to set an upstream branch, again; You should get some warning.

This response would also help, if both remotes weren't labeled to push as 'origin'.

9301293
  • 484
  • 3
  • 16
  • It is working. Apparently, I ran the commands more than 1 time and created some unexpected errors. But when I ran "git remote -v". It only showed one push destination. – acyk Jun 12 '18 at 18:01