- git commit を取り消して変更を残す🔙
git reset --soft HEAD~1
- git リポジトリのコピー
git push --mirror
- git 特定ブランチからの全ファイルのコピー
git restore --source=[commit] .
- git fetch して自分が古いと分かった場合
「Your branch is behind 'origin/feature_ulp' by 2 commits, and can be fast-forwarded.」
- 変更なし → git pull
- コミット済み変更あり → git rebase origin/main
- 未コミット変更あり → git stash → pull → stash pop
- 全部捨てる →
git reset --hard origin/main or git reset --hard @{u}
- git タグ管理 ... タグはcommitとは別に管理
- タグ付け
git tag -a v1.0.0 -m 'テスト"
- タグ一覧
git tag か git tag -l か git tag -n99
- リモートへ送る
git push --tags 新しい git では git push --follow-tags
- タグ一覧リモート
git fetch --tags; git tag -n