When this happens, this is kind of a loss of a mojo as well and this has happened to me a lot.
I am had to do a git push -u origin master
and then the commit was rejected. Has this happened to you too? Fret not.
Image courtesy of http://Studytonight.com.
I stumbled upon a post on Stackoverflow on how this should be done:
https://stackoverflow.com/a/59790434/11083275. which irons out the problem entirely.
- Can't push.
- What did I do?
git push -f origin master
- Why did I do that? To upload my last commit!
- What was the consequence? Well everything was loaded but for every readme I did from my last lot of commits!
- How to put that right? As per the article above, the next steps would be...
- git fetch origin master
- git pull origin master
- git add .
- git commit -m 'your commit message'
- git push origin master
If you now check your github you should find that master to master was successful.✅
Ok everyone, have fun 😂!!
Top comments (1)
Just tried that, it works!!