2 AWS CodeCommit repositories with the same name and region

0

I am migrating a branch from one codecommit repo to another. Both Repos are on different accounts but have the same name and are in the same region. I connect to them using HTTPs so both have the same URLs (h/t/t/p/s://git-codecommit.region.amazonaws.com/v1/repos/repoName)as well. How do I push a branch from one repo to another?

KM
asked 3 months ago108 views
1 Answer
0

Git can sort it out automagically once you clone the repo.

Just checkout on the branch you want to migrate and add the remote repo as a new remote for the clone. Then just push !

git clone #urlofyourgitrepo#/v1/repos/repoName

git checkout branchName

git remote add destination #urlofyourgitrepo#/v1/repos/repoName

git push destination branchName

profile picture
EXPERT
answered 3 months ago
  • Hello Giovanni, Let me elaborate further. I'm working with two AWS CodeCommit repositories that have the same name (MyDemoRepo) and the same URL (https://gi/t-co/dec/ommit/.us-west-1.amazonaws.com/v1/repos/MyDemoRepo). I'm on a branch feature-xyz in the source repo and need to push it to the destination repo with a prefix, making it new-feature-xyz. My problem here:

    1. The URLs to push/clone are the same. When I clone the source repo and try to push to the destination repo, the branches are getting pushed back to the source repo instead
    2. I do not have AWS Access keys or GUI access for the 2 AWS accounts, only two HTTPS Git credentials for AWS CodeCommit to connect to the two repos. How can I do this?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions