Willem Hoek  »  Most common Git commands

Jan 01, 2020

Basic commands

Copy (clone) your repositories (‘repo’) from remote (e.g. GitHub) to local pc.

git clone REPO_NAME

Add changes to staging area (Index), commit to local and push to remote.

git add .
git commit -m "notes"
git push 

Get updates (pull) and restore local tree

git pull
git restore *


git clean -i 
git reset
git branch
git log
git status
git config --global user.name "Your name" 
git config --global user.email your@email.com 


Managing SSH keys

On Windows. When using git with GitHub – you can set up your SSH keys to avoid typing in your GitHub username/password when working on your own repos:

To see if it all work, try this after adding key ssh -vT git@github.com


[1] Pro Git
The entire Pro Git book, written by Scott Chacon and Ben Straub is available online
https://git-scm.com/book/en/v2, Accessed 2020-03-11