(1)需求需要将旧代码库中的指定分支推送到新的Git仓库。(2)步骤1.新建Git仓库2.将本地代码仓库切换到新的Git仓库地址#替换remotegitremoteset-urloriginhttp://***.gitgitremoteset-urlorigin--pushhttp://***.git3,将新的SSH证书添加到远程新建Git仓库所在的SSH认证码库中ssh-keygen-trsa-C"email"catid_dev_rsa.pub#将生成的公钥复制到Git仓库在该账户的SSH账户中添加#,可能会遇到没有权限的问题,需要设置全局密码cd~/.ssh/gitconfig--listgitconfig--globaluser.name"name"gitconfig--globaluser.password"password"gitconfig--globaluser.email"email"4.推送当前分支代码//推送代码gitpush5.切换本地分支,继续推送分支代码//推送代码gitcheckout
