Skip to content

Instantly share code, notes, and snippets.

@Chunlin-Li
Last active July 23, 2016 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chunlin-Li/825c97cc4251217372151467161e454f to your computer and use it in GitHub Desktop.
Save Chunlin-Li/825c97cc4251217372151467161e454f to your computer and use it in GitHub Desktop.
webstorm git integration combine multiple commit when push to remote. squash commit into one.

当前分支上, 本地已经有多个 commit 了. 此时想将这些零散的 commit 合并成一个.

context menu -> git -> repository -> rebase

勾选 interactive

onto 选定的是 remote 上对应当前本地分支的分支. 如 refs/remotes/origin/master

from 什么都不选

其他 checkbox 全空; merge strategy 默认值 default.

点 rebase 后出现 commits 对话框, 此时将列表中的第一个 commit 置为 pick. 后面的都置为 squash. 然后下一步. 应该是可以调整 commit 的顺序, 但必须保证第一行的 commit 是 pick.

修改并提交整合后的 commit message 信息. 完成.

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