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 πŸ˜‚!!

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (1)

Collapse
 
fion21 profile image
Fion L β€’

Just tried that, it works!!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay