Git Cli

High Frequency

$ git reflog
$ git rebase -i HEAD~2

상태

$ git status

$ git log
$ git log -g
$ git log --pretty=short
$ git log {file name}
$ git log --graph

# stage와 working tree의 차이
$ git diff

# stage와 working tree의 차이
$ git diff HEAD

$ git reflog

# git log all branch
git log --graph --oneline --decorate --all

Merge

# prevent fast-foward merge
$ git merge --no-ff {branch name}

Commit

# commit and add
$ git commit -am

Branch

$ git branch -a

Remote

# git fetch all remote branch
git fetch --all

Push

# upstream option
$ git push -u origin master