官术网_书友最值得收藏!

How to do it...      

The following are the steps for migrating a project or repository hosted on another Git repository to AWS CodeCommit:

  1. Firstly, we have to create a CodeCommit repository named HelloWorld (refer to the previous CodeCommit repository either using HTTPS or SSH). 
  1. After creating a CodeCommit repository, clone it to the local machine. Since we are cloning the repository using an HTTPS connection, then we need to give the HTTPS credentials of username and password (you can refer to the previous recipe):
    root@awsstar:~# git clone https://git-codecommit.us-east-    1.amazonaws.com/v1/repos/HelloWorld
Cloning into 'HelloWorld'...
Username for 'https://git-codecommit.us-east-1.amazonaws.com': awsccuser-at-1xxxxxxxx39
Password for 'https://awsccuser-at-16xxxxxxx39@git-codecommit.us- east-1.amazonaws.com':
warning: You appear to have cloned an empty repository.
Checking connectivity... done.

3. Now, clone a GitHub repository using --mirror into another new folder. Here we have a GitHub repository whose name is Docker-Compose-CI-CD, which will be cloned into a pre-existing empty folder precommit:

>

     root@awsstar:~# mkdir precommit
root@awsstar:~# git clone --mirror https://github.com/awsstar/Docker-Compose-CI-CD.git precommit
Cloning into bare repository 'precommit'...
remote: Counting objects: 36, done.
remote: Total 36 (delta 0), reused 0 (delta 0), pack-reused 36
Unpacking objects: 100% (36/36), done.
Checking connectivity... done.
  1. Go to the directory where you made the clone: 
    root@awsstar:~# cd precommit/
  1. Run the git push command, specifying the URL and name of the destination AWS CodeCommit repository and the --all option:
    root@awsstar:~/precommit# git push https://git-codecommit.us-east-    1.amazonaws.com/v1/repos/HelloWorld --all
Username for 'https://git-codecommit.us-east-1.amazonaws.com': awsccuser-at-160384169139
Password for 'https://awsccuser-at-160384169139@git- codecommit.us- east-1.amazonaws.com':
Counting objects: 36, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (33/33), done.
Writing objects: 100% (36/36), 3.73 KiB | 0 bytes/s, done.
Total 36 (delta 17), reused 0 (delta 0)
To https://git-codecommit.us-east- 1.amazonaws.com/v1/repos/HelloWorld
* [new branch] master -> master
  1. Now, let's view the migrated files in AWS CodeCommit:

Here, we can see how easily we have migrated the project from GitHub to AWS CodeCommit.

主站蜘蛛池模板: 马山县| 舟曲县| 右玉县| 巨野县| 遂宁市| 章丘市| 葵青区| 许昌县| 嘉鱼县| 北辰区| 达孜县| 邵武市| 同江市| 汶上县| 桐柏县| 晋江市| 黑河市| 南召县| 长岭县| 昆明市| 晴隆县| 阿拉尔市| 新沂市| 长乐市| 泰顺县| 故城县| 皮山县| 丹巴县| 钟祥市| 宁津县| 宜丰县| 金寨县| 鄯善县| 收藏| 灵武市| 罗定市| 曲阜市| 蒙山县| 尚志市| 宁南县| 莲花县|