Git - could not read Username for 'https://github.com',push报错解决办法
2023-09-11 14:21:34 时间
执行git push命令异常,如下:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags --set-upstream origin refs/heads/master:refs/heads/master Pushing to https://github.com/gongyuhonglou/PlaylistVaporServer_Swift.git fatal: could not read Username for 'https://github.com': Device not configured Completed with errors, see above
原因:
.git文件下 config文件中url/pushurl没有用户身份信息:
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true precomposeunicode = true [remote "origin"] url = https://github.com/gongyuhonglou/PlaylistVaporServer_Swift.git fetch = +refs/heads/*:refs/remotes/origin/* pushurl = https://github.com/gongyuhonglou/PlaylistVaporServer_Swift.git [branch "master"] remote = origin merge = refs/heads/master
解决:
在请求串中加入身份信息即可,格式为:
https://[userName]:[password]@github.com/[username]/project.git
修改后:
[remote "origin"] url = http://gongyuhonglou:000000@github.com/gongyuhonglou/PlaylistVaporServer_Swift.git fetch = +refs/heads/*:refs/remotes/origin/*
注:000000代表密码
如果还是不能解决的话,就在终端操作git push:(提示手动输入github账号和密码)
macdeMacBook-Pro:Vapor mac$ git push Username for 'https://github.com': github账号 Password for 'https://wengrp@yeah.net@github.com': github密码 Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done.
相关文章
- github 上有趣又实用的前端项目(持续更新,欢迎补充)
- Github.com的Git和TortoiseGit图文教程
- 【学习总结】Git学习-GIT工作流-千峰教育(来自B站)
- [Git] Recover Local Changes from `git reset --hard` with `git reflog`
- [Practical Git] Navigate git command pager output with Unix less commands
- [GitHub] 1. Configuring Git
- Git远程04:git fetch & git push & git pull
- 在mac上使用github--设置git
- 【学习总结】Git学习-上传本地已有代码到GitHub
- 【学习总结】Git学习-参考廖雪峰老师教程八-使用GitHub
- Android Studio 将github作为远程maven仓库
- github 小技巧
- [转] Python 爬虫的工具列表 附Github代码下载链接
- 一个用JavaScript生成思维导图(mindmap)的github repo
- 给广大码农分享福利:一个业界良心的github仓库,中文计算机资料
- 什么是Github的元数据metadata以及如何备份github上的数据
- 一个最简单的 Github workflow 例子
- github sshkey
- GitHub创建项目入门学习
- git分享:Git_DataPro
- github和bitbucket
- 【Github教程】史上最全github用法:github入门到精通
- 超全的App 测试工具大全,收藏这篇就够了【附带官网|GitHub地址】
- Git 管理工具 SourceTree 的使用(上手简单,不熟悉git命令的开发者必用)
- fatal: unable to access ‘https://github.com/用户名/项目名.git/‘: OpenSSL SSL_read: Connection was reset, e
- 【分布式版本控制系统Git】| IDEA 集成 Git 、IDEA 集成 GitHub
- 怎么找文章的代码?【通过github】
- [Git & GitHub] git 常用命令