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
タグ
タグ作成
code:sh
git tag -a v0.1.0 -m "First prototype version"
タグ一覧
code:sh
git tag
リモートのタグ削除
code:sh
git push --delete <repository> <tag>
ローカルのタグ削除
code:sh
git tag -d <tag>
Push
code:sh
git push origin <tag>