ashwatermelon

ashwatermelon

【Study Notes】The "error: failed to push some refs to" issue when uploading with git

Here's the thing, some time ago I tried to create a GitHub repository to record the code I wrote during my learning process, and recently I frequently encountered the following issue when uploading.
image
Then after entering git pull, this situation would occur.
image
While writing this article, I realized it might be because I modified the readme file, but the solution I proposed is not this.
At that time, I searched for a while and finally found the solution at https://blog.csdn.net/L_smwy/article/details/121400574
The method used was solution two, but first, I backed up some things locally.
image
Then I put the backed-up items back and re-uploaded, and that solved the problem.
It seems that the issue was likely caused by modifying the readme file locally. I made the change because I noticed that the readme I downloaded was missing a line compared to what was written on GitHub, but it seems this thing shouldn't be modified locally.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.