提交中的拼写错误以及如果"提前1次提交"该怎么办

Tyr*_*yra 4 git

我做了一些事情,并意识到我的评论有拼写错误,所以我git commit -m "xxx"再次输入,并更正了评论.

因此,我不能像git push所说的那样推动任何事情

Everything up-to-date

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit. 
#
nothing to commit (working directory clean)
Run Code Online (Sandbox Code Playgroud)

我现在能做什么?

Phi*_*ler 5

git rebase -i origin/master将为您提供更正上游存储库之外的提交的机会.那么你可以git push得到结果.


zet*_*tic 5

正如Novelcrat指出的那样,你可以在推送之前以交互方式进行修改以修复提交.将来,如果您在提交消息中出错,可以使用它进行编辑git commit --amend