git - 如何摆脱 "You are currently editing a commit"?

标签 git

突然出现:

MacBook-Pro: $ git status
On branch dev
Your branch is up-to-date with 'dropbox/dev'.
You are currently editing a commit while rebasing branch 'Releases' on '72ca998'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit, working directory clean

分支没有变化。一切都是最新的。

最佳答案

git rebase --abort 应该中止 rebase 操作并返回到之前的状态。但可以肯定的是,你之前输入了什么命令?

编辑:git reflog 的输出可以告诉你 rebase 是从哪里开始的,它看起来像这样

7d0b010 HEAD@{0}: rebase finished: returning to refs/heads/bran
7d0b010 HEAD@{1}: rebase: adding file in branch
a7e6693 HEAD@{2}: rebase: checkout master
a7e6693 HEAD@{3}: commit: adding file in master
4c00dd7 HEAD@{4}: checkout: moving from bran to master
3cb192a HEAD@{5}: commit: adding file in branch

关于git - 如何摆脱 "You are currently editing a commit"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31252363/

相关文章:

git - 在种子项目上构建时如何组织 git repos

svn - 如何 "unversion"svn 和/或 git 中的文件

windows - 为什么 git 在 Windows 下记不住我的密码

git - 将项目迁移到 Git/Gerrit。访问控制问题?

git 将本地提交的更改移动到新分支并推送

OS X 上的 Git 从 1.8.3.4 更新到 1.8.4.2

windows - 无法完全删除 git 存储库

git - 再次从 master 中删除提交

git - 在 cygwin 中调用 git commit 时 vim 不工作

git - 去巴泽尔 : Using external Git repositories