# How to Git
## start a local git
`git init`
## set up git info
`git config --global user.name "name"`
`git config --global user.email "example@gmail.com"`
## check which branch I am:
`git branch`
## switch branch:
`git checkout __branch-name__`
### switch branch while creating one:
`git chackout -b __branch-name__`
## add to staging:
`git add .`
## commit to branch:
When you done some process.
`git commit -m "commit msg"`
## push to remote:
Upload it to remote git server after commit.
`git push origin __remote-branch-name__`
## pull from remote:
Update your local branch to catch up remote.
`git pull origin __remote-branch-name__`
## stash (存放) unsaved change:
> Scenario:
When you want to switch to other branch without committing current one.
### *create a stash*
`git stash`
### *restore a stash*
`git stash apply`
### *delete a stash*
`git stash drop`
### *restore and delete a stash*
`git stash pop`
### *check stash queue*
`git stash list`