Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS codecommit migration

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 ?

like image 741
ULLAS K Avatar asked Mar 08 '23 17:03

ULLAS K


1 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
like image 93
jarnohenneman Avatar answered Mar 10 '23 09:03

jarnohenneman