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 再提交 就能把代码提交上去了