landbryo
5/18/2018 - 6:27 PM

Useful git commands

Git commands I've come to find useful and want to find in one place.

git clone https:// // clone repository
git add -A // stages all
git add . // stages new and modified, without deleted
git add -u // stages modified and deleted, without new
git commit -m "add message here" //commit changes with a message
git push origin master //push changes to master branch

git reset --hard
git pull

SOURCES:
https://stackoverflow.com/questions/572549/difference-between-git-add-a-and-git-add
https://stackoverflow.com/questions/14318234/how-do-i-ignore-an-error-on-git-pull-about-my-local-changes-would-be-overwritt
https://alvinalexander.com/git/git-cheat-sheet-git-reference-commands