1

Trying to start learning DX. I have the project set up and downloaded a simple package from a demo org. But I get an error when I try to commit to Github.

/Desktop/GloboHealth/globohealthDX$ git push origin master

fatal: unable to update url base from redirection: asked for: https://github.com/bdJohnson72/GloboHealth/upload/info/refs?service=git-receive-pack redirect: https://github.com/bdJohnson72/GloboHealth `

The result of git remote -v is

origin  https://github.com/bdJohnson72/GloboHealth/upload (fetch)
origin  https://github.com/bdJohnson72/GloboHealth/upload (push)
upstream        https://github.com/bdJohnson72/GloboHealth.git (fetch)
upstream        https://github.com/bdJohnson72/GloboHealth.git (push)

I can't figure out what is going on here. I followed the link. And it asks for a branch. But I have a master branch set up. Any help would be appreciated.

  • Brooks, what is the output of git remote -v? – David Reed Jan 19 '19 at 13:58
  • Hi David, I am getting – Brooks Johnson Jan 19 '19 at 17:33
4

I'm not really sure how your repo got into this state, but you have two remotes (server repos to which you can push changes from your repo) configured, and one of them (upstream) has the wrong URL.

You don't need two remotes here because they're actually both pointing at the same repo, your bdJohnson72/GloboHealth repo on GitHub.

I would fix origin by doing

git remote set-url origin https://github.com/bdJohnson72/GloboHealth.git 

and then remove upstream by doing

git remote rm upstream

Then you should be able to push to origin.

Not the answer you're looking for? Browse other questions tagged or ask your own question.