比如说,将 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-demoCloning 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 0Receiving objects: 100% (229/229), 4.52 MiB | 46.00 KiB/s, done.Resolving deltas: 100% (25/25), done.[root@192 ~]# lsanaconda-ks.cfg tomcat-java-demo tomcat-java-demo.bak[root@192 ~]# cd tomcat-java-demo[root@192 tomcat-java-demo]# lsdoc 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 masterUsername for 'https://github.com': lousia001Password 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 -> masterBranch master set up to track remote branch master from origin.
到此, 代码迁移成功。
作者:
出处:
关于作者:专注软件测试,测试运维相关工作,请多多赐教!
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出, 欢迎沟通交流加微信联系。 微信:yangguangkg20140901 暗号:博客园.