DEV Community

Shaikh Al Amin
Shaikh Al Amin

Posted on

Squashing without using git squash

Git squash alternatives using reset:

If your target pull request branch is master, then follow the below steps.

Note: You can change the steps to your dev/qa branch as well. just change master branch to your target branch

— git config pull.rebase false
— git checkout master
— git pull origin master

— git checkout CURRENT_WROKING_BRANCH

— git pull origin master

— git reset $(git merge-base master CURRENT_WROKING_BRANCH)

— git add changes …
— git commit -am “ticket-name commit message”
— git push -f
Enter fullscreen mode Exit fullscreen mode

Now create a pull request your master branch

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

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

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay