相关疑难解决方法(0)

在Git上更改旧的提交消息

我试图为解释编辑旧提交信息在这里.

问题是,现在,当我试图运行rebase -i HEAD~5时说interactive rebase already started.

所以然后我尝试:git rebase --continue但是得到了这个错误:

error: Ref refs/heads/master is at 7c1645b447a8ea86ee143dd08400710c419b945b but expected c7577b53d05c91026b9906b6d29c1cf44117d6ba
fatal: Cannot lock the ref 'refs/heads/master'.
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

git repository rebase git-rebase

126
推荐指数
6
解决办法
10万
查看次数

我如何`git rebase -i`并阻止"你要求修改最近的提交,但这样做会使它变空."?

我想跑一个git rebase -i some-hash.

当我运行它时,我收到错误:

您要求修改最近的提交,但这样做会使其为空.您可以使用--allow-empty重复命令,也可以使用"git reset HEAD ^"完全删除提交.
[...]
无法申请[...]

该错误似乎特定于单个提交,因为--allow-empty这不是我可以传递给rebase的选项.

显然--keep-empty我是一个可以传递的选项git rebase,但它似乎没有解决问题.

如果rebase中的提交最终没有效果,我怎么能改变并告诉git呢?

git git-rebase

19
推荐指数
2
解决办法
5272
查看次数

使用空提交消息重新发布git历史记录

我最近转换了一个svn存储库git svn.不幸的是,svn历史记录有许多空提交消息.当我在没有提交消息的最近提交之前重新定义和编辑/重新提交提交时,这是一个问题.

$ git rebase -i d01
[detached HEAD ff9839c] asdf
 2 files changed, 9 insertions(+), 0 deletions(-)
Aborting commit due to empty commit message.
Could not apply 054e890... 

$ git branch
* (no branch)
  master

$ git commit --amend
fatal: You are in the middle of a cherry-pick -- cannot amend.
Run Code Online (Sandbox Code Playgroud)

在这个例子中,我为第二次最近的提交做了一个提交消息,提交了一个空提交消息,并且在最近一次提交时使用空提交消息停止了.

我想一次编辑所有提交空消息的提交.有没有办法可以做到这一点?也许我可以使用空提交消息更改所有提交以使提交消息首先"空"?

git

15
推荐指数
3
解决办法
5281
查看次数

标签 统计

git ×3

git-rebase ×2

rebase ×1

repository ×1