0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Githubのコミットメッセージを直したい場合

0
Posted at

前提

  • やり方2つある

直前の場合

git commit --amend -m "修正後のコミットメッセージ"
git push --force-with-lease

過去のコミットメッセージを修正したい場合

# 直近3件の中から修正する場合
git rebase -i HEAD~3

# エディタが開くのでメッセージ編集したい箇所の pick を reword に直す

<変更前>
pick 298e8d9 [add]Windows2019をもう一台追加
pick 4f8ffd7 [add]snapshot
pick ee1dd9e [fix]AmazonLinux2023.t sの keyPairNameを正しいのに修正

<変更後>
pick 298e8d9 [add]Windows2019をもう一台追加
pick 4f8ffd7 [add]snapshot
reword ee1dd9e [fix]AmazonLinux2023.t sの keyPairNameを正しいのに修正

<その後> 以下だけが出てくるので、修正する
[fix]AmazonLinux2023.t sの keyPairNameを正しいのに修正

リモートブランチの上書き

git push --force-with-lease

Github 側の画面で修正されていることを確認する

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?