Show Menu
Cheatography

git_cheatsheet Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Instal­lation

Windows
Ubuntu
# apt-get install git
Centos
# yum install git
Fedora
# dnf install git

Settings

git config --global user.name "John Doe"
git config --global user.email "­joh­n@v­iet­tel.co­m.v­n"
git config --global http.proxy "­soc­ks5­://­192.16­8.1.2:­699­6"

Init

git clone -v --progress user@1­92.1­68.1.2:proje­ct.git
git init
Initialize an existing directory as a Git repo

Branch

git branch
List branches (* is current branch)
git branch branchname
Create new branch
git merge branchname
Merge remote branch to current branch
 

Before modify code

git checkout master
Change to master branch
git pull
Get commits from remote branch