Gitのよく使うコマンド
VanillaNote Git
# Gitのよく使うコマンド
# ログ系
# 1行表示
git log --name-status
1
2
2
# reset系
# 作業コピーのリセット
git checkout .
1
2
2
# リポジトリ整理
# ローカルブランチ表示と削除
git branch
git branch -D ブランチ名 # 未マージでも削除merge
git branch --delete ブランチ名 # マージ済みで駆除
1
2
3
4
2
3
4
# リモートブランチ削除
git branch --remote
git push --delete origin ブランチ名
1
2
2
# コミットをまとめる
# ログの成形
git log --date=format-local:'%Y/%m/%d %H:%M:%S' --pretty=format:" %C(magenta)コミット : %h%n 日時 : %ad%n コミットmsg : %s" -1 --name-status
1
# 出力先が端末のときに色をつけて表示する
git config --global color.ui auto
1
# ステータス
git status --short --branch
1