This is a draft cheat sheet. It is a work in progress and is not finished yet.
Installation
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 "john@viettel.com.vn" |
git config --global http.proxy "socks5://192.168.1.2:6996" |
Init
|
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 |
|