问题1
第一次在pycharm中提交代码时出现Author identity unknow
解决方法
打开本地的git Bash窗口然后按提示输入:
git config --global user.name "tom-gitee" git config --global user.email "xxxxx@qq.com"
这样去重新上传应该就可以了。
问题2
我后面上传时又报了一个错:
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
解决方法
我的小白做法:我去Gitee上把之前自动创建的PythonTest库删了,然后重新share project on gitee,就没有报错了。当然这是因为我在练习Git提交,库里没有东西,所以直接删了。
正常解决方案:我搜了一下,这是因为远程仓库代码比本地新,有人在你push之前push过了(可是明明就我一个人在push....)
执行一下以下命令就能解决:
git rebase origin/远程分支名
git push
rebase的作用就是在你本地再回放一下目标分支领先的commit,然后继续执行相关命令即可。