1

I have a node server on Heroku and their terminal extension for git. How can I use both repositories separately? I have a repo on github that I want to use for a different project yet I cannot switch the push destination, it all goes to heroku master.

How do I change the branch? I've tried several ways already of setting a git origin branch and trying to push directly to it but it all still shows a heroku master.

screenshots removed for privacy, see resolution details in comments

Micard
  • 379
  • 2
  • 15

1 Answers1

1

You can change the remote tracking branch of your current branch with:

git branch branch_name -u your_new_remote/branch_name

In your case:

git branch master -u origin/master

That would make git status and git push consider the remote origin instead of heroku.

Other solutions are possible:

git config branch.master.remote origin

This assume that origin does exist.
If it does not (see git remote -v output), you can declare that new destination with:

git remote add origin /new/destination/url

If you want to completely replace an existing origin setting (for push and pull):

git remote set-url origin /new/destination/url

If you just want the push url

git remote set-url --push origin /new/destination/url

See "Change the remote URL to your repository".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250