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.


✅ Step 1: Create a Temporary Amplify App

Start by creating a new temporary Amplify app from the AWS Amplify Console.

image.png

This app will act as a proxy to trigger the GitHub authentication flow again.


🔐 Step 2: Authorize GitHub Repository Access

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.

image.png

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

image.png

This will give us desired Choose repository step like below screenshot

image (2) (1).png


✅ Step 3: Complete Setup and Delete the Temporary App