4

I have a fully working application with data persisted in the database but I need to change the github repository associated with it. So I have something like:

https://github.com/foo/bar

And I need to change to:

https://github.com/bar/foo

Without doing anything to the application hosted and without losing data. Is there any way to do this?

asked Jan 21, 2015 at 22:12
5
  • Unless I'm missing something, Heroku doesn't know (or care) what your GitHub repository is called. You don't even need a GitHub repository to use Heroku. Don't you push to it from a local copy? Commented Jan 21, 2015 at 22:47
  • I have a local folder called A, which is hosted at github as github.com/A, what I need to do is change heroku to read from my folder B, which is hosted at github as github.com/B Commented Jan 21, 2015 at 23:03
  • Well, Heroku doesn't "read from" local folders. Nothing at Heroku will change until you push to it, or change settings. Do A and B share history? Commented Jan 21, 2015 at 23:09
  • A and B are the same. I simply had to change the repository from a personal to a organisation. Commented Jan 21, 2015 at 23:15
  • So just deploy your next version from B. Heroku doesn't know what machine or directory you pushed from. Commented Jan 22, 2015 at 0:13

1 Answer 1

2

If you're using Heroku's Github integration (where Heroku either automatically deploys a specific Github branch or you can choose a branch to deploy manually) you can disconnect your old repository and connect the new one. Navigate to Deploys tab, and click the Disconnect... button in App connected to Github section:

Disconnect button

Then connect your new repository as you did initially.

Note that if your repository was transferred to another account / organization you may need to grant Heroku permissions to access that. When you do so and reconnect the repository you may find two Heroku webhooks installed, under Settings / Webhooks on Github. One of those will be shown as failing - just remove the one that fails.

answered Apr 10, 2021 at 13:58
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.