2

We are using AWS Code Commit for source code and considering moving to Github in the near future. What is the easiest way to accomplish this ? I have seen a lot of articles about importing a Github project into AWS Code commit but not the other way around.

Suman
  • 31
  • 1
  • Why would it be different going the other way, or any other Git migration? Add a remote for GitHub and push your code. – ChrisGPT was on strike Apr 22 '19 at 00:29
  • Thanks Chris. i am new to Github. So are there any pointers/articles explaining how to add a remote for Github ? – Suman Apr 22 '19 at 10:11
  • Yes, [there are lots](https://duckduckgo.com/?q=add+second+git+remote). We're not here to find things for you. Please read about what's on-topic in the [help/on-topic]. Try something. If you get stuck, search. If you don't find anything, come back and ask a _concrete_ question. – ChrisGPT was on strike Apr 22 '19 at 11:29
  • Thanks again for your quick response. Not sure if there is a need to be rude here. If you don't want to respond please don't. I will try out a few things with GitHub and come back with questions as needed. – Suman Apr 22 '19 at 15:09
  • I didn't intend to be rude. I was merely pointing out that certain things are on-topic here and others are off-topic. Since you brought it up, reading and following a community's guidelines might be considered a polite thing to do. We also have a [tour] that you don't appear to have taken (doing so earns you a bronze badge). – ChrisGPT was on strike Apr 22 '19 at 16:42

2 Answers2

1

Simplest way is to clone your code commit repo and push it to your GitHub repo.

user11389395
  • 287
  • 1
  • 2
0

I think this is a very fair question and none of the comments have addressed it. Though it is trivial to migrate the git repo, that is not a full clone of all meta data related to it. This is roughly:

  1. git clone --mirror <source repo>
  2. Create new, empty repo in a GitHub org you can write to
  3. git add remote target <dest repo>
  4. git push --mirror target

What gets missed doing git migrations like this is things such as users/groups permissions, pull requests, secrets, and probably other things I've forgotten. This meta data is not stored in the git repo and needs to be re-implemented on the GitHub side. As there are usually APIs to the Git systems, migration scripts can be written and some are written by GitHub, some by individuals (though I struggled to find any active examples).

I too have searched extensively for a migration tool that actually gets all the data for an AWS CodeCommit repo and reproduces it as a GitHub repo.

It looks like I should be able to write a script that uses the AWS REST API to get the data and then write it to the GitHub API. I was hoping this code already existed and I would save a bunch of time writing and debugging it.

Martin
  • 2,316
  • 1
  • 28
  • 33