Recently at work, I encountered a situation where I needed to change the GitHub repository connected to an AWS Amplify app. However, Amplify doesnât offer a direct or obvious way to swap repositories once an app is set up. Rebuilding everything from scratch wasnât ideal, especially when the existing backend, environment and Domain configurations needed to be preserved.
After some trial and error, I found a reliable method to switch the repository by temporarily authorizing GitHub access through a placeholder app, using the AWS CLI, and reconnecting the branch. This post outlines the step-by-step solution I used â hopefully, itâll save you some time if you run into the same problem.
Start by creating a new temporary Amplify app from the AWS Amplify Console.
This app will act as a proxy to trigger the GitHub authentication flow again.
During the app creation process, Amplify will prompt you to connect your GitHub account. You will see a GitHub OAuth popup asking you to grant access.
Sometimes even after you connect your Github Account. you might not be able to get into Choose repository step. For that look for Update Github Permission in the App Dashboard
This will give us desired Choose repository step like below screenshot