Quick references for basic tasks with git.

<aside> ☝ For easier tasks, just use Gitkraken to make things visually. However, it's paid.

</aside>

Installation & Tools

Rules to be more effective

Settings on local machine

# SET GLOBAL INFO
git config --global user.name "Anh-Thi DINH"
git config --global user.email "[email protected]"
# SPECIFIC REPO
git config user.name "Thi"
git config user.email "[email protected]"
# Verify your configuration
cat .git/config
# IF: `Could not resolve host: github.com`
git config --global --unset http.proxy
git config --global --unset https.proxy
# SAVE GITHUB AS DEFAULT
# (don't need to log in again every time we use)
git config credential.helper store
git pull
# FORMATTING DISPLAY
git config color.ui true # add colors to the results
git config format.pretty oneline # display only one line of each commit

Check the status

# CHECK STATUS
git status
git status -s # modified files
# Get remote list
git remote -v
# WITH COLORS
git log --oneline --graph --color --all --decorate
# --graph: draw text-based branches
# --decorate: display names and tags