Skip to content

Instantly share code, notes, and snippets.

@bradthurber
Last active July 12, 2023 13:56
Show Gist options
  • Save bradthurber/bc0a57379799da3414fe83faed22ccd2 to your computer and use it in GitHub Desktop.
Save bradthurber/bc0a57379799da3414fe83faed22ccd2 to your computer and use it in GitHub Desktop.

How to make a single commit branch from a big feature branch

## create a new branch from the latest main branch
$ git checkout -b latest_MCode

## Now merge your feature branch into latest_Mcode branch
$ git merge --squash feature-branch

## before pushing - make sure the commit message is correct
$ git commit --amend

## no push etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment