Git——git push 错误[error: src refspec master does not match any]解决方案
生活随笔
收集整理的這篇文章主要介紹了
Git——git push 错误[error: src refspec master does not match any]解决方案
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
問題描述?
git push -u origin master error: src refspec master does not match any error: failed to push some refs to 'https://github.com/XXX/XXX.git'問題分析
1.本地git倉庫目錄下為空
2.本地倉庫add后未commit
3.git init錯誤
4.沒有g(shù)it add添加文件
解決方案
1.控制面板打開文件夾選項??打開隱藏文件和文件夾顯示
2.到本地倉庫目錄下查看是否有.git文件夾——無 則git init
3.看.git文件夾下是否有之前提交的文件——若無 則重新 git commit
注:如果之前git add過的話 沒有就要重新 add commit
4.新裝的git要留意是否需要配置用戶名和郵箱名
5.git status檢查是否有添加文件,git add添加文件
?
參考文章
https://blog.csdn.net/qq_38198952/article/details/82792279
https://blog.csdn.net/wangwangwanglichao/article/details/79983262
https://blog.csdn.net/z000123456789/article/details/100622482
總結(jié)
以上是生活随笔為你收集整理的Git——git push 错误[error: src refspec master does not match any]解决方案的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: VS Code——Live Server
- 下一篇: Git——git push 错误[ !