我想修改我刚刚提交的提交消息,所以我尝试这样做:
git commit --amend
(就像我通常做的那样),但我得到了一个错误:
Unable to find modified files; please check git status
现在这很奇怪,因为我不是试图从提交中添加/删除文件,我只是想更改消息,所以我是否修改了文件并不重要。
任何人都可以解释这个错误信息(理想情况下,我怎样才能克服它)?
* 编辑 *
Mellowcandle 请求了我的 git 状态;这是(或多或少):
# On branch some_branch
# Your branch is ahead of 'origin/some_branch' by 1 commit.
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: static/js/someFile.js
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# some/other/file
# yet/another/file
* 编辑 #2 *
当我尝试git rebase -i
(with reword
) 时也会出现同样的问题。
* 编辑 #3 *
这是git config --list
GoZoner 要求的(略微匿名)的输出:
user.name=My Name
user.email=email@example.com
push.default=upstream
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@github.com:someGitHubAccount/Apps.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.deploy.remote=origin
branch.deploy.merge=refs/heads/deploy
...*more branches that look similar*