Git新手常见问题总结

一. Please tell me who you are
1. 问题描述:初次使用git时,会遇到这样的提示
Please tell me who you are.
Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
2. 解决:参考提示,在命令行运行如下命令,Tell git who you are
git config --global user.email  "abc@example.com"
git config --global user.name "Your Name"
二. fatal: remote origin already exists.
1.问题描述:重复git remote add origin 同一个远程仓库时,会出现这个错误,可以理解为重复对origin进行绑定出错
2. 解决:
git remote rm origin 
三. 使用https://github.com/../..域名提交项目,会要求提交用户名和密码,用户名即github账号,密码即github的密码
四. Please make sure you have the correct access rights
1.问题描述:初次提交项目到远程仓库,会出现错误如下,原因是没有在远程配置本地密钥
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
2.解决:
  1. 使用 ssh-keygen -t rsa -C "xxx@example.com"生成密钥
  2. 在~/.ssh 目录下,有id_rsa,id_rsa.pub两个文件,把id_ras.pub的内容添加到github.com的账号下。
    参考廖雪峰git教程
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 1. 安装 Github 查看是否安装git: $ git config --global user.name "...
    Albert_Sun阅读 14,657评论 9 163
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,083评论 19 139
  • Git的使用 首先登录https://git.oschina.net,如没有账号进行注册. Git简单介绍 Git...
    Sunney阅读 3,904评论 0 2
  • 古人云“行万里路读万卷书”,这是使人之生命丰富的过程。读书、学习是认知自然和世事的起始,是建立自我价值观和世界观的...
    山贼爷阅读 1,571评论 0 0
  • 残破的云再也遮不住天 大地通明 凉凉秋风起 白水过涧 蝉虫和鸣 万千草木耕作在山野 顾不得拭去满身的汗 尚且活着的...
    我的爱在蔓延伴着南风阅读 1,814评论 0 2

友情链接更多精彩内容