Git
Command
ローカル確認
code:sh
cat ~/.gitconfig
Config
git initのブランチをmainに変更しておこう
code:sh
git config --global init.defaultBranch main
差分
ワークツリー<>ステージ
code:sh
git diff
ステージ<>Repository
code:sh
git diff --staged
Log
ログ表示
code:sh
git log
最近のN個分のログ
code:sh
git log -n N
削除
File削除
code:sh
git rm
Repository削除
code:sh
git rm -cached
取り消し
ステージの状態に戻す(ワークツリーの変更を取り消す)
code:sh
git checkout
最新のコミットの状態に戻す(ステージの変更を取り消)
code:sh
git reset HEAD
直前のコミットを元に戻す
code:sh
git commit --amend
取得
code:sh
git pull