Skip to content

7.6 Git のさまざまなツール - 歴史の書き換えでの間違い #108

Open

Description

ファイルを編集して git add したり追跡中のファイルを git rm したりしてステージングエリアをお好みの状態にしたら、続いて git commit --amend を実行します。すると、現在のステージングエリアの状態を次回のコミット用のスナップショットにします。

というところ

英語版では

If, on the other hand, you want to change the actual content of your last commit, the process works basically the same way — first make the changes you think you forgot, stage those changes, and the subsequent git commit --amend replaces that last commit with your new, improved commit.

なので

すると、現在のステージングエリアの状態を次回のコミット用のスナップショットにします。

ではなく
すると、新しい改善されたコミットで最後のコミットを置き換えます。

の意味ですよね。
正:現在のステージングエリアの状態を使ったコミットで最後のコミットが置き換わる
誤:現在のステージングエリアの状態を次回のコミット用のスナップショットにする

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions