Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
修正されたコミットをプッシュしようとすると、git がエラーを表示するのはなぜですか? (やったcommit - push - amend - push --> error)
commit - push - amend - push --> error
Git の各コミットはハッシュによって識別されます。
たまたま、特定のハッシュを使用して最初のコミットをプッシュします。git commit --amend次に、(コマンドを使用して) コミットを歪めてハッシュを変更します。
git commit --amend
したがって、サーバーに再度プッシュすると、彼はあなたが何をしたいのか理解できないため、エラーが発生します。
次の方法でこのエラーをオーバースティープできますgit push -f your_origin your_branch。推奨されませんが、可能です。
git push -f your_origin your_branch