git 上传 显示403问题 解决方案

本文档记录了在使用Git时遇到的权限错误403和CRLF警告问题的解决过程。首先,通过删除控制面板中的Git凭证并重新输入账号密码解决了远程推送失败的问题。接着,针对LF到CRLF的转换警告,通过设置`git config core.autocrlf false`成功避免了文件转换并在后续提交中避免了报错。
git init
git config --global user.name "xxxxx"
git config --global user.email "xxxxxxxxx@qq.com"
git add .
git commit -m "first commit"
git remote add origin https://gitee.com/zhurenbing/cgb2109.git
git push -u origin master

然后我的电脑报错

$ git push -u origin master
remote: [session-314242ab] Access denied
fatal: unable to access 'https://gitee.com/xxxx/xxxxxx.git/': The requested URL returned error: 403

此时 找到控制面板里的 凭据管理器   把普通凭据里面关于 git账户 删了  重新执行 git push -u origin master  就会弹框输入自己的账号密码  然后就可以上传   

git add . 出现下列报错

D:\project3\2109>git add .
warning: LF will be replaced by CRLF in springdemo1/.gitignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in springdemo1/.mvn/wrapper/MavenWrapperDownloader.java.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in springdemo1/.mvn/wrapper/maven-wrapper.properties.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in springdemo1/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in springdemo1/mvnw.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in springdemo1/mvnw.cmd.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in springdemo1/pom.xml.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in springdemo1/src/test/java/com/jt/Springdemo1ApplicationTests.java.
The file will have its original line endings in your working directory 

执行   git config core.autocrlf false  再提交 就能把代码提交上去了

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值