git push --force and how to deal with it

16-Aug-2024 604
Now, if you’re thinking, “this doesn’t sound like something I’d ever do”, well, let’s not get overly confident. Sooner or later, this is going to happen. When working with several remotes in the same Git repository, eventually, you will git push --force into main (or another important branch that should’ve never been messed with).This might happen, for instance, when deploying with Heroku, which uses separate Git remotes to build and deploy an application. Following a long day of work, it could be incredibly easy to execute git push --force instead of the usual git push --force heroku main.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle