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)

ACI image

ACI.dev: Best Open-Source Composio Alternative (AI Agent Tooling)

100% open-source tool-use platform (backend, dev portal, integration library, SDK/MCP) that connects your AI agents to 600+ tools with multi-tenant auth, granular permissions, and access through direct function calling or a unified MCP server.

Star our GitHub!

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay