VSCode连接Github的重重困难及解决方案!
一、背景:
- 我首先在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