Skip to content

Instantly share code, notes, and snippets.

@ostashevdv
Last active July 28, 2016 11:43
Show Gist options
  • Save ostashevdv/0d7a0e608094391952013e9fb0df9d92 to your computer and use it in GitHub Desktop.
Save ostashevdv/0d7a0e608094391952013e9fb0df9d92 to your computer and use it in GitHub Desktop.
Git: собрать последние N коммитов в один
git reset --soft HEAD~3
git commit -m 'new commit message'

3 заменить на N.

Работает и на уже push-нутых ветках, если потом делать git push --force. Последняя команда заменят ветку целиком, так что с ней надо быть особо осторожным.

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