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 😂!!

AWS Q Developer image

Your AI Code Assistant

Ask anything about your entire project, code and get answers and even architecture diagrams. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Start free in your IDE

Top comments (1)

Collapse
 
fion21 profile image
Fion L

Just tried that, it works!!

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

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

Okay