Open5

Git

xoxoxoxo

git インストール後
https://github.com/Shinpeim/introduction-to-git/blob/master/05_branch.md
$ git config --global alias.graph "log --graph --date-order --all --pretty=format: '%h %Cred%d %Cgreen%ad %Cblue%cn %Creset%s' --date=short"
$ git config --global alias.graph "log --graph --addrev-commit --decorate --format=format: '%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"

xoxoxoxo

$ git checkout -b main
$ git add README.md

$ git commit -m "initial commit"
$ git push origin main

$ git checkout -b develop
$ git push origin develop

$ git fetch origin
$ git merge --ff origin/develop

xoxoxoxo

• ローカルリポジトリが追跡しているリモートリポジトリの確認
$ git branch -vv

• リモートブランチを追跡するローカルリポジトリの作成
$ git branch feature/redmine_1000 origin/feature/redmine_1000
$ git branch -a

• リモートブランチでは削除されているが、ローカルリポジトリに参照が残っているブランチを表示
$ git remote prune --dry-run origin

• すでに削除されているリモートブランチのローカル参照を削除する
$ git remote prune origin

• リモートブランチを削除
$ git push origin :feature/redmine_1000

• Git LFS
$ git lfs version

• トラッキングファイルの拡張子を登録
$ git lfs install
$ git lfs track "*.dll"

xoxoxoxo

git stash saveでmasterブランチで作業ツリー上の変更を退避します。
$ git stash save

git stash listで変更がstash上に登録されていることを確認します。
$ git stash list

変更の移動先となるfeatureブランチをチェックアウトします。
$ git checkout feature

退避した変更をgit stash popでfeatureブランチに適用
$ git stash pop

xoxoxoxo

$ git checkout -b feature/xxxxx
$ git add README.md
$ git commit -m "initial commit"
$ git push origin feature/xxxxx
$ git checkout -b develop
$ git fetch origin

  • 存在すれば
  • $ git pull origin

$ git merge --ff origin/feature/xxxxx
$ git push origin :feature/xxxxx
$ git branch -d feature/xxxxx