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