一、背景:
- 我首先在github創建了一個新的項目,并自動創建了readme文件
- 其次在vscode創建項目并寫了兩個文件
- 在我想將vscode的項目上傳到對應的github上時,錯誤出現了
二、報錯及解決方案:
1.解決方案:
????????需要在git上配置用戶名和郵箱:
2.配置代理
git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890
3.git push origin master
報錯:fatal: 'origin' does not appear to be a git repository
a.用了這位佬的方法連接到了github:git 解決 fatal: 'origin' does not appear to be a git repository-CSDN博客
b.再次push,報錯:git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas
用這個方法配置了ssh:解決git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas-CSDN博客
c.再次提交,報錯:Updates were rejected because the tip of your current branch is behind
報錯原因:GitHub內容與本地不
push前先將遠程repository修改pull下來
git pull origin master
git push -u origin master