LoginSignup
1
1

More than 3 years have passed since last update.

【gitコマンド】差分を確認・直前のコミットを修正する

Posted at

差分を確認

git diff

差分のあるファイル名を確認
git diff --name-only

直前のコミットメッセージを修正する

git commit --amend
viが開くので、コミットメッセージを編集する
:w write(上書き)
:q quit(終了)
で完了。
git logで確認します

直前のコミットを修正する

ファイルを追加し忘れたり、何か間違った時

git add 追加したいファイルのパス
git statusで確認
git commit --amend
viが開くので、コミットメッセージを編集する。git logで確認します

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1