Willem Hoek  »  Most common Git commands

Posted on January 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 *

Other

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 

sample

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

Edit