Git Cheatsheet

Usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# git clone
git clone [github-repo-url]
git clone -l /path/to/git copy-to-destination

# git init
git init
git init --bare

# add or update your file(s) / folder(s)
git add .

# commit
git commit -m "your commit message"

# push your code to remote repo
git push

# pull your code from remote repo
git pull

branch

1
2
3
git branch
git reset
git checkout exist-branch