fatal: Could not read from remote repository.的解决办法
原文地址:http://blog.csdn.net/huahua78/article/details/52330792
---------------------------------------------------------------------------------
查看遠端地址?git remote –v?
查看配置?git config --list
git status
git add . // 暫存所有的更改git checkout . // 丟棄所有的更改git status // 查看文件狀態git commit -m "本次要提交的概要信息" // 提交
- 1
- 2
- 3
- 4
設置遠端倉庫地址?git remote set-url origin 你的遠端地址?
git push origin master出現以下情況:
解決辦法:刪除當前key,然后重新生成key,
會在本地C:\Users\你的用戶名.ssh生成文件夾,里面有id_rsa和id_rsa.pub兩個文件?
然后復制id_rsa.pub文件里面的內容,到https://github.com/settings/keys新建一個,?
?
設置遠程地址:(上面新建的)?
git remote add origin_new 新的地址?
git remote –v查看?
git push origin_new master重新推送?
下面是設置用戶名?
Git config –global user.name “用戶名”?
git config –global user.email 郵箱地址
設置代理:?
git config –global https.proxy?http://127.0.0.1:1080?
取消設置代理:?
git config –global –unset https.proxy
取消git init操作時出現?rm: cannot remove ‘.git’: Is a directory?
是因為輸入的命令是:?rm -f .git?
解決辦法:rm -rf .git?即刪除整個.git目錄
failed to push some refs to ‘git@github.com:*.git’ hint: Updates were rejected ···?
使用git push origin master的時候出現一下錯誤:
解決辦法:?
git push -f origin master或者git pull下
恢復不小心刪除的?git stash?文件:
git fsck //找到dangling的對象 git show id //上面列出的每一條記錄的最后一個字符串,按 enter 查看具體信息 git stash apply id- 1
- 2
- 3
git 回滾提交
//reset將一個分支的末端指向另一個提交。這可以用來移除當前分支的一些提交, 讓master分支向后回退了兩個提交 git checkout master git reset HEAD~2//Revert撤銷一個提交的同時會創建一個新的提交, 找出倒數第二個提交,然后創建一個新的提交來撤銷這些更改,然后把這個提交加入項目中。 git revert HEAD~2- 1
- 2
- 3
- 4
- 5
- 6
錯誤:Please enter a commit message to explain why this merge is necessary.?解決辦法:?
1. (可選)按鍵盤字母 i 進入insert模式?
2. (可選)修改最上面那行黃色合并信息?
3. 按鍵盤左上角”Esc” (退出insert模式)?
4. 輸入”:wq”,按回車鍵即可(提交)
版權聲明:本文為博主原創文章,未經
總結
以上是生活随笔為你收集整理的fatal: Could not read from remote repository.的解决办法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Mybatis源码阅读(一):Mybat
- 下一篇: 第15章 知识管理