Skip to main content

git command snippets

clone repo

git clone https://github.com/microsoft.com/Typescript.git

init new git project

git init`

create new git branch

git checkout -b name

check the status of git repo

git status`

undo all changes

git restore .`

discard/undo changes in index.html file

git restoreindex.html

show log of [Commit History](commit-history)

git log

undo to most recent Commit AND del Diff

git reset --hardHEAD

flag files/folders to not track in .gitignore file

remove git from

rm -rf .git

References