ashwatermelon

ashwatermelon

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

Recently, I tried to create a GitHub repository to record some code I encountered during my learning process, but I frequently encountered the following issue when uploading.
image
After entering git pull, this situation would occur.
image
While writing this article, I realized that 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.
I used solution two, but first backed up some things locally.
image
Then I put the backed-up items back and re-uploaded, which resolved the issue.
It seems that the problem was likely due to modifying the readme file locally. I modified it because I noticed that the downloaded readme was missing a line compared to what was written on GitHub. It seems that this thing shouldn't be modified locally.

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