git rebase不会显示所有提交

时间:2019-05-01 10:09:05

标签: git

我想对旧提交进行更改。一些建议告诉我,我应该使用git rebase。但是git rebase并未显示我想要更改的提交。

这是我的提交日志:

commit 0ace2fbbd6a86fc23971a16eb3b94106245ccc3d (HEAD -> master, origin/master, origin/HEAD)
Author: MarinZhang <<C2><96>1475705241@qq.com>
Date:   Wed May 1 12:17:45 2019 +0800

    3st commit

commit fa0aa7a8a335c568f2e10fcf529c7fc069f797e6
Author: MarinZhang <<C2><96>1475705241@qq.com>
Date:   Wed May 1 12:17:30 2019 +0800

    2st commit

commit 1ca2657ed28c47420b82f0696fbb6288b4a8d381
Author: MarinZhang <<C2><96>1475705241@qq.com>
Date:   Wed May 1 12:17:14 2019 +0800

    1st commit

我想更改为“第一次提交”,所以我输入git rebase -i 1ca2657ed28c47420b82f0696fbb6288b4a8d381

结果是:

pick fa0aa7a 2st commit
pick 0ace2fb 3st commit

# Rebase 1ca2657..0ace2fb onto 1ca2657 (2 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# .       create a merge commit using the original merge commit's
# .       message (or the oneline, if no original merge commit was
# .       specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.

如图所示,结果不包含pick 1st commit。 有人告诉我应该在所属行pick上将edit更改为1st commit。 但是我找不到1st commit行,这很令人困惑。

对此有何建议?

0 个答案:

没有答案