跟着廖雪峰老师的教程在windows上安装了git,以下纪录学习过程中可能出现的各种问题及解决方案:
1、git add readme.txt出现的问题
fatal: not a git repository (or any of the parent directories): .git |
![](https://img-blog.csdnimg.cn/1d8e2e68d23741b7973bc39f4a6e3b2b.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAd2VpeGluXzQ2NDc4MDYx,size_11,color_FFFFFF,t_70,g_se,x_16)
?在教程中老师有解释是文档放置位置的问题,Windows用户如果是用记事本编写的,保存后去目录下找到这个.txt文件并用Visual Studio Code方式打开,不然还是会报错,这应该就是老师课程里说的记事本的bug了吧
PS:还是乖乖下载Visual Studio Code吧
2、git commit -m""出现的问题
*** 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.
fatal: unable to auto-detect email address (got '86156@DESKTOP-DBA7PKR.(none)') |
![](https://img-blog.csdnimg.cn/68877a616276415caf78688f3cd95d41.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAd2VpeGluXzQ2NDc4MDYx,size_13,color_FFFFFF,t_70,g_se,x_16)
?这个问题主要就是初始化的时候没有设置好用户名还有邮箱,已经注册GitHub的小伙伴要记得把用户名还有邮箱设置成注册GitHub时用的名字和邮箱,不然会一直run不起来。
(刚学到这,后面还没遇到什么问题,边学边持续更新~)
|