我平时没有写作的习惯,不为别的只是觉得口才与写作能力太差,现在的生活越来越注重细节,我也开始记录记录我工作与闲暇之余遇到的一些问题,希望这些能为我自己做一些知识点梳理,顺便也能帮助遇到问题的人。
很就不上github,里面也没啥东西,无意中上了发现了好早之前用CSS做的一个扫描的百分比文字没有居中,刚好看了table-cell的用法能够用上,在使用github进行push的时候报403的错,具体错误如下:
14:13 Push failed: Failed with error: unable to access 'https://github.com/pimingyue/css3.git/': The requested URL returned error: 403
找了很多方法都不能进行
1.修改config的用户名和邮箱
git config --global user.name pimignyue
git config --global user.email mingyuepi@aliyun.com
结果:成功修改配置文件名字与邮箱,push失败 |
2.https改为ssh方式
git remote set-url origin [url]
结果:成功修改,push失败 |
3.git用户名密码缓存
a) 配置git用户名和邮箱
git config --global user.name pimignyue
git config --global user.email mingyuepi@aliyun.com
b) 输入命令查看本机credential 是否被清空
git config credential.helper
如果输入之后有返回值 ,表示满意被清空,我的返回值是manager
c)可能本机中不止一个config文件,找出配置文件清空credential
git config --show-origin --get credential.helper
d)再次输入步骤b就没有返回值了
e)重新配置成store
git config --global credential.helper store
可以直接修改config文件credential.helper=store
第一次push 的时候会提示输入用户名密码,输入完成之后/Users/xxx/ 文件夹下会生成一个新的文件.git-credentials,双击打开,里面保存了你的用户名密码等信息
结果:成功修改,push成功 |