Skip to content

Instantly share code, notes, and snippets.

@kunwardeep
Last active January 30, 2019 00:21
Show Gist options
  • Save kunwardeep/7d8337fc6d976afb60bbc9c97fa95abd to your computer and use it in GitHub Desktop.
Save kunwardeep/7d8337fc6d976afb60bbc9c97fa95abd to your computer and use it in GitHub Desktop.
Merge all commits from a branch into a single commit
git checkout yourBranch
git reset $(git merge-base master $(git rev-parse --abbrev-ref HEAD))
git add -A
git commit -m "one commit on yourBranch"
git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment