git config {option}
git checkout -b {local_branch_name} {origin/remote_branch_name}
git config core.autocrlf
true
git config --global core.autocrlf false
git config core.autocrlf
false
-
ls: git ls-files
-
commit back: git rest --hard hash
-
- git rest HEAD {file_name}
- git reset --soft ワークディレクトリの内容はそのままでコミットだけを取り消す
- git reset --hard コミット取り消した上でワークディレクトリの内容も書き換える
-
Push local branch to remote branch
- git checkout {local_branch_name}
- git origin {remote_branch_name}
-
- git rm {file_name}
- git rm -r {dir_name}
- git rm --cached {file_name} ファイルを残してgitの管理対象外にする
-
- git stash (save) ("foovarbuz")
- git stash save -u with untrack files
- git stash list
- confirm changes: git stash -p
- git stash show {stash_name}
- git stash show -p {stash_name} show files diff
- git stash show <適用したstash名> -p | git apply -R apply で復活して取り消しいたい場合、git stash show -p パッチ形式で出力、git apply -R でパッチを逆に適用
- git stash apply stash@{0}
- git stash drop stash@{0}
- git stash pop apply update stash, delete old
- git stash pos stash@{N} apply N stash, delele old
-
- git branch -a
- git fetch
- git checout -b {your_branch_name} {origin/remote_branch_name} -b: automatic branch checkout
-
- git commit --amend -m '' 「git commit --amend」を使用した場合、元のコミットを上書きするのではなく、元のコミットを無効にして、新たなコミットを作るという動作
-
- git show HEAD
- git show HEAD^^ 最新の2つ前にログを見る HEAD~2 も同じ