DEV Community

Naveen Niraula
Naveen Niraula

Posted on

Consequences of for-Git-ting to merge the master into feature branch!

First off, pardon my not so punny title.

Second, let's start by clarifying this isn't a guide or a how to. It's just how I unf*cked my situation (that I created) just before a release.

I understand this might not be the best possible way. But let's just assume it is for my situation (any inputs are welcome, for my future F ups.

Context:

  • My PR got reviewed and was ready to be shipped.
  • Next, I see changes in master ( main, whatever ); saw conflicts in my branch (didn't merge it, OOOPS 0!)
  • Changed files in my branch; commit -> pushed (OOOPS 1!)
  • Merge master (conflicts in the same files and lines that I pushed, resolved it without thinking what the changes were on master, OOOPS 2!)

(In the above stage I assumed that master would adjust and separate to my changes from itself, OOOPS 3!)

  • PR got updated, but now as you guessed it was in abnormal state where master's changes were overwritten by mine)

Enter: Panic mode

After 1 hour of discussion of what should be done, I decided to soft reset it ~2 commits.

UNF*CKING Process

First, I reverted the commits that caused the issue using git reset --soft HEAD~2. Great, now what ?

Tried to git push current state; git rejected caused well I effed up.

I did what a normal person (in a mental asylum) would do.

git push --force (TADA), everything's good.

It worked because I was the only PERSON working on that branch. I do not recommend the --force in any situation but well I don't really know any alternative.

Now, the wizards on dev.to please enlighten me if that was the correct approach. Or it should've been something else.

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
🎥 Audio/video file upload with real-time preview
🗣️ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
📤 Export interview's subtitles in VTT format

Read full post

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay