Git Commands

Git Basic

initialises current repository for git

adds README.md file

commit staged changes with message initial commit

creates local branch named main

adds a remote origin to current git repository

pushes committed changes to remote origin repository

displays help for specified command

Git Config

configures the initial branch name to use in all of new repositories

Branch

shows all local branches

shows all local and remote branches that (local) Git knows about

creates specified branch locally

renames just created branch

switches to specified branch

pushes specified branch (mostly newly created local branch) to remote

updates the local list of remote branches

deletes local branch

deletes local branch with un-merged and un-pushed changes

deletes remote branch

Status/History/Record

shows all local changed files

Stash

lists all stashes

un-stashes/pops first stash in stack

un-stashes/pops first stash in stack


Add

adds...

adds all local changed files

Commit

commits locally with specified commit message

amends most recent un-pushed commit message (all staged changes will also be committed)

Push

pushes locally committed changes to remote branch

Reset