这里使用的是pycharm,git和gitee。
解决方法参照:Gitee操作极速上手指南: 使用 Git 进行本地与远程之间的推送,拉取,修改,删除等操作中的第三步
进行git add 记录.doc报错:
fatal: detected dubious ownership in repository at
解决参照:
解决Git报错:fatal: detected dubious ownership in repository at-CSDN博客
进行最后一步git push -u origin master显示:
$ git push -u origin master
To gitee.com:xiwen-li/socket.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'gitee.com:xiwen-li/socket.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
错误的原因为远程库和本地库是分别建立的没有关联在一起,解决方法:进行合并分支操作参照:
【Git】合并分支出现 Please enter a commit message to explain why this merge is necessary.-CSDN博客
将上面的步骤复现一遍,会遇到报错解决一下,全部解决后就能进行正常推送了
其中出现的,笔者目前也没搞懂为什么没关联上,我使用的是pycharm直接建立本地库并使用了URL感觉关联上了,但是就是不行。我复现上述步骤就碰到那两个问题,如有其他问题欢迎提出