DEV Community

Cover image for Lost your README?
Fion L
Fion L

Posted on

1 1

Lost your README?

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.

  1. Can't push.
  2. What did I do? git push -f origin master
  3. Why did I do that? To upload my last commit!
  4. What was the consequence? Well everything was loaded but for every readme I did from my last lot of commits!
  5. 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
Enter fullscreen mode Exit fullscreen mode

If you now check your github you should find that master to master was successful.✅

Ok everyone, have fun 😂!!

Imagine monitoring actually built for developers

Billboard image

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitor creation and configuration with Monitoring as Code.

Start Monitoring

Top comments (1)

Collapse
 
fion21 profile image
Fion L

Just tried that, it works!!

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay