Monday, December 17, 2012

Heroku App Rename From Web Stops your Git Commit From Working

I recently discovered Heroku. And it's easy to make a mess ..err.. mistake when you are new. I recently created a new app on Heroku and renamed it from the web interface on a whim. Suddenly my Git command-line failed complaining my app did not exist - oops! Did you do that too? Here's a way out of the mess.

Why did this happen?
Changing the app name also changed the Git URL. Particularly the remote. What was first:

git@heroku.com:my-original-name.git

now becomes:

git@heroku.com:my-new-name.git

Particularly painful when you have outstanding changes pending a commit.


Understood, how do I sort this?
Luckily that's the easy part - as soon as you know how ;-) Execute the following two commands:

$git remote rm heroku
$heroku git:remote -a my-new-name

And now try your Git commit - Phew!

Lesson learnt?
Oh yes! Stick to either command-line or GUI - especially when you are new to things. Saves a lot of time :)

[Heroku documentation - Renaming Apps from the CLI]

Labels: , , ,

2 Comments:

At 3/13/2013 7:19 am, Anonymous manojglobal said...

Again, awesome web log!



Load Junction, load matching
Services, Find Truck Loads, Find Freight and Trucks

 
At 9/20/2013 5:01 am, Anonymous Daniel said...

Awesome! I googled "heroku oops i renamed my app" and this was the second result, works like a charm =)

 

Post a Comment

<< Home