Github: 从github上拉取别人的源码,并推送到自己的github仓库

比如说,将 https://github.com/lizhenliang/tomcat-java-demo 迁移到 https://github.com/lousia001/tomcat-java-demo

步骤如下:

#从https://github.com/lizhenliang/tomcat-java-demo拉取代码
[root@192 ~]# git clone https://github.com/lizhenliang/tomcat-java-demo Cloning into 'tomcat-java-demo'... remote: Enumerating objects: 229, done. remote: Counting objects: 100% (229/229), done. remote: Compressing objects: 100% (205/205), done. remote: Total 229 (delta 25), reused 180 (delta 5), pack-reused 0 Receiving objects: 100% (229/229), 4.52 MiB | 46.00 KiB/s, done. Resolving deltas: 100% (25/25), done. [root@192 ~]# ls anaconda-ks.cfg tomcat-java-demo tomcat-java-demo.bak [root@192 ~]# cd tomcat-java-demo [root@192 tomcat-java-demo]# ls doc Dockerfile LICENSE pom.xml README.md src
# 修改隐藏的  .git/config文件,替换掉一样
[root@192 tomcat-java-demo]# vi .git/config

 


[root@192 tomcat-java-demo]# git remote add origin https://github.com/lousia001/tomcat-java-demo.git
[root@192 tomcat-java-demo]# git push -u origin master
Username for 'https://github.com': lousia001
Password for 'https://lousia001@github.com': 
Counting objects: 229, done.
Compressing objects: 100% (185/185), done.
Writing objects: 100% (229/229), 4.52 MiB | 1.32 MiB/s, done.
Total 229 (delta 25), reused 229 (delta 25)
remote: Resolving deltas: 100% (25/25), done.
To https://github.com/lousia001/tomcat-java-demo
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

 

到此, 代码迁移成功。 

作者: 梅梅~

出处: https://www.cnblogs.com/keeptesting

关于作者:专注软件测试,测试运维相关工作,请多多赐教!

本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出, 原文链接 欢迎沟通交流加微信联系。 微信:yangguangkg20140901 暗号:博客园.

posted on 2019-03-21 14:41  梅梅~  阅读(13504)  评论(0编辑  收藏  举报

导航