对于已经修改提交过的注释,如果需要修改,可以借助 git commit --amend 来进行。
例如 在framework/base 里最新的提交就是 resolving the roaming problem,我现在需要将其改为 resolving the roaming problem for fixing bug 7732
在 framework/base 下 输入 git commit --amend,就会进入一个文本编辑界面(如下),在注释的地方修改 ,保存然后退出,这样注释就修改了,再重新push.
resolving the roaming problem
Change-Id: I7e7daffd2e8a5e65130629dc1c56dee5f5c4b5f7
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch shuai.lu_branch
# Changes to be committed:
# (use "git reset HEAD^1 <file>..." to unstage)
#
# modified: telephony/java/com/android/internal/telephony/gsm/GsmServic$
#
例如 在framework/base 里最新的提交就是 resolving the roaming problem,我现在需要将其改为 resolving the roaming problem for fixing bug 7732
在 framework/base 下 输入 git commit --amend,就会进入一个文本编辑界面(如下),在注释的地方修改 ,保存然后退出,这样注释就修改了,再重新push.
resolving the roaming problem
Change-Id: I7e7daffd2e8a5e65130629dc1c56dee5f5c4b5f7
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch shuai.lu_branch
# Changes to be committed:
# (use "git reset HEAD^1 <file>..." to unstage)
#
# modified: telephony/java/com/android/internal/telephony/gsm/GsmServic$
#
本文介绍如何利用git commit --amend命令来修改已提交的注释信息,并通过一个具体示例进行说明。当需要更改最近一次提交的信息时,此方法非常实用。
5504

被折叠的 条评论
为什么被折叠?



