linux - 无法提交或推送到 github,而且我没有启用 2 因素身份验证
问题描述
我收到“无效的用户名或密码”错误。
此外,我收到我的身份验证失败的消息。
试图推动:
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/theseareprojects/testproject.git'
远程验证:
origin https://github.com/theseareprojects/testproject.git (fetch)
origin https://github.com/theseareprojects/testproject.git (push)
验证自己的信息:
user.email=theseareprojects@protonmail.com
user.name=theseareprojects
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/theseareprojects/testproject.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
我的信息是正确的...
大声笑这有点卡住了,所以谢谢你的帮助。我什至没有启用 2 因素身份验证。这让我困惑了很长一段时间。
解决方案
我认为你错过了一次提交。一步一步尝试,
git add .
git commit -m "initial project commit"
git push origin master
但是,如果已经提交,您也可以尝试以下作为本地参考独立解决方案。这表示您希望将本地HEAD
ref 推送到远程master
ref。
git push origin HEAD:master
推荐阅读
- typescript - 如何在 Vue3 SFC 中导入打字稿文件并使用 laravel mix 构建它
- flutter - 从本地设备 Flutter 加载视频
- python - Python在Django应用程序中抛出变量范围错误
- sql - 如何将表格 CSV 拆分为行
- cmd - 错误 AttributeError:模块 'twint' 没有属性 'config'
- python - Python Google Classroom API“TypeError:列表索引必须是整数或切片,而不是 str”
- javascript - gsap 说 e 没有定义
- javascript - 如何使用 Cypress 配置 Cookie?
- php - Laravel 从 URL 更改主键会导致错误
- dataframe - Julia - 搜索所有列缺失的行并删除这些行的函数