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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

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

Okay