May be its simple question but I am not able to find right document to implement this. I have two aws account i.e personal P and Office O. For experiment purpose initially I have created Codecommit and attached 8 GIT projects. There are four users using P aws user credetntials and accessing it from last 6 months. There three branches and more than 100 commits. Now I want to move all these projects to Official account O without losing history of commit and its branches . I can safely take the master branch and create new repo ,but I need all history and branches. Can some one help me out ?
3 Answers
Would suggest looking at GitHub, they recommend using --mirror function "Duplicating a repository". My understanding is that this also work on AWS CodeCommit.
It uses:
- git clone --mirror: to clone every references (commits, tags, branches)
- git push --mirror: to push everything
That would give:
git clone --mirror https://codecommit-url/exampleuser/repository-to-mirror.git
# Make a bare mirrored clone of the repository
cd repository-to-mirror.git
git remote set-url --push origin https://codecommit-url/exampleuser/mirrored
# Set the push location to your mirror
git push --mirror

- 963
- 10
- 21
-
Thanks for the quick answer. I will try this link and update you. – ULLAS K Oct 30 '17 at 10:17
Assuming you wish to continue using Codecommit. Then you have the ability to migrate all aspects of the codebase using the git --mirror command. Here is a link which relates to want you want to do
Bear in mind that access credentials to the new repo will need new credentials generated by the IAM service.
Good luck

- 641
- 4
- 17
Basically, your goal is to clone the full repository using 'mirror' option, and push that repository to your CodeCommit repository in another account. These instructions assume you want to keep the same repository name for both accounts P and O. (And it's assuming your repo name is MyDemoRepo).
- git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo --mirror
- Configure credentials for CodeCommit account O (this may mean updating/invalidating your existing OS credential cache)
- cd MyDemoRepo
- git push --mirror

- 591
- 2
- 5