LoginSignup
0
0

More than 5 years have passed since last update.

git 忘れがちなコマンド メモ

Posted at

たまに使う忘れがちなgitのコマンドをメモ程度に
いちいち調べるの面倒だしね

ブランチの名前を変更

今いるブランチの名前を変更

git branch -m <新しいブランチ名>

今いるブランチ以外の名前を変更

git branch -m <古いブランチ名> <新しいブランチ名>

ブランチ削除

リモートブランチ削除

git push --delete origin <消したいブランチ名>

ローカルブランチ削除

git branch -D <消したいブランチ名>

git log系

そのコミットでコミットされたファイルと修正箇所を表示

git log -p <コミットID>

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

git commit --amend
もしくは
git commit -m '修正版コメント' --amend
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