Skip to content

Git Essentials


icon: ---icon: material/format-title

Git configuration

git config --global user.name "your name"
git config --global user.email "[email protected]"

Initialize or clone a repository

git init
git clone <repository-url>

Check status and add changes

git status
git add .
git add <file>
git restore <file>
git rm --cached <file>

Commit changes

git commit -m "Your commit message"
git commit -am "Commit message with auto add of tracked files"

Branch management

git branch
git branch <new-branch>
git checkout -b <new-branch>
git switch <branch-name>
git merge <branch>
git branch -d <branch>

Push / Pull / Fetch

git remote add origin <remote-url>
git push origin <branch-name>
git pull
git fetch

View history and info

git log
git show

Check remote

git remote -v