git本地仓库删除后从远程仓库更新代码


1、$ ssh-agent bash

2、$ ssh-add ~/.ssh/id_rsa_hyp 添加ssh密匙

3、$ git fetch git@github.com:xxx.git master 从远程仓库fetch项目

4、也可以git fetch git@github.com:xxx.git master:temp建立新分支temp,将代码合并到新分支temp上,在删除新分支temp

5、$ git merge FETCH_HEAD 合并项目

6、$ git status 查看状态

7、$ git add -A 增加修改后的文件

8、$ git commit -m "optimization write protection!" 提交

9、$ git remote add origin git@github.com:xxx.git 添加远程仓库

10、$ git push -u origin master 推送到远程仓库


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM