DEV Community

Pete McFarlane
Pete McFarlane

Posted on

Chaos branching in Git

When you're working on a feature branch, but that feature branch has had a lot of merges with other branches and sub-feature branches, you just want to unset the diff between all the files in one, chaos branch, and master you can run

> git checkout yourBranch
> git reset $(git merge-base master yourBranch)

(source from StackOverflow answer)

Now you have one big change list, it's time to use git commit -p or your favourite git GUI to make selective commits into something more logical, ready to submit as a pull request.

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more