If case you ever need to map your git remote back to an existing url do this:
> git remote -v
heroku git@heroku.com:protected-reef-4420.git (fetch)
heroku git@heroku.com:protected-reef-4420.git (push)
origin git@github.com:rasmus4200/agilenutshell.git (fetch)
origin git@github.com:rasmus4200/agilenutshell.git (push)
Right now heroku is pointed at protected-reef. But I want it to point to:
hidden-ridge-8790.herokuapp.com
To do that is use this command:
> git remote add heroku git@heroku.com:hidden-ridge-8790.git
> git remote -v
heroku git@heroku.com:hidden-ridge-8790.git (fetch)
heroku git@heroku.com:hidden-ridge-8790.git (push)
origin git@github.com:rasmus4200/agilenutshell.git (fetch)
origin git@github.com:rasmus4200/agilenutshell.git (push)
Done
http://git-scm.com/book/ch2-5.html
Update: If you don’t have your heroku remote created, do this:
> heroku create
> git remote set-url heroku git@heroku.com:hidden-ridge-8790.git
Jason Noble
Apr 14, 2013 @ 17:10:24
JR, you have a typo on the first line, it should be ‘git remote -v’. Also, if I try to git remote add with a remote that already exists (heroku), git gives me an error: “fatal: remote heroku already exists.”.
What you should do instead is “git remote set-url heroku git@heroku.com:hidden-ridge-8790.git”.
JR
Apr 16, 2013 @ 13:16:07
This is what I love about the internet. People helping people. Thank you. Noted and fixed.
Your solution is better. Saves removing it that adding back (can just set instead).
Excellent!
Thanks again Jason.
Andy Palmer
Apr 16, 2013 @ 13:32:14
Do you have two heroku instances for the same application? Are you using something like Blue-Green deployment?
I’ve used blue and green for remotes, so that I can deploy to either without setting and unsetting the URLs.
You may also have live and staging etc..
JR
Apr 16, 2013 @ 15:24:23
Hi Andy. No I don’t have anything like that. Just local and prod.
Just checked out your website. Love your maintainable code presentation.
Including here for anyone who may like to read.
http://andypalmer.com/2012/11/maintainable-code/
Thx for your comment.
Saroj maharjan
Nov 23, 2017 @ 17:12:00
hello , below is my `git remote -v` . My problem may be beyound your topic but if you can help I would be grateful.
when I installed heroku cli and deployed my code to heroku by git push heroku master command, I am now stucked on heroku and its branch master.
I want to go back to my local gitlab branch and work on its branch but I am not being to go back to my local gitlab. I am on heroku branch whatever I do.
Do you have any solution friend?
heroku https://git.heroku.com/myapp.git (fetch)
heroku https://git.heroku.com/myapp.git (push)
origin git@gitlab.com:raju/myapp.git (fetch)
origin git@gitlab.com:raju/myapp.git (push)
JR
Nov 23, 2017 @ 17:50:18
Working locally is all about what branch you are currently on. Chances are you are already working locally. It’s just when you push to prod you specify the prod remote.
My suggestion would be to make a small change. Try checking it into your origin remote. And verify you can make local changes. Something like.
git checkout -b testbranch
(change a file)
git add .
git commit -m “Test”
git push origin testbranch
Don’t worry if this is confusing. Git is confusing. If this doesn’t work my advice would be to create a test repos and just to play around with git on a test project until you are comfortable. It took me some time to learn all the commands.
Good luck!
Heroku Change Remote Url? The 14 Latest Answer - Ko.taphoamini.com
Jun 14, 2022 @ 03:10:26