在 GitI 中有以下情况:
o "ok" b6ca869 [my_branch*]
|
o "ok" 479d27c
|
o "ok" c80fad5
|
o "ok" 8f7fe87
|
o "master commit message" [master][remotes/origin/master]
我想压缩这 4 个“ok”提交并更改消息
o "my_branch commit message" [my_branch*]
|
o "master commit message" [master][remotes/origin/master]
所以我要做的是
git rebase --interactive master
并打开了 GNU nano(我在 Ubuntu 上)编辑器
GNU nano 2.2.2 File: /home/.git/modules/src/android/frameworks/base/rebase-merge/git-rebase-todo
pick 8f7fe87 ok
pick c80fad5 ok
pick 479d27c ok
pick b6ca869 ok
# Rebase aeedb8f..b6ca869 onto aeedb8f
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
据我了解,我必须编辑此文件,但实际上我不知道如何。