Skip to content

Instantly share code, notes, and snippets.

View zmonteca's full-sized avatar

zmonteca zmonteca

View GitHub Profile
@zmonteca
zmonteca / cheatsheet-git.sh
Last active July 31, 2019 19:51 — forked from raineorshine/cheatsheet-git.sh
Cheatsheet: git commands
# adding and committing
git add -A # stages All
git add . # stages new and modified, without deleted
git add -u # stages modified and deleted, without new
git commit --amend # Add staged changes to previous commit. Do not use if commit has been pushed.
git commit --amend --no-edit # Do so without having to edit the commit message.
# remotes - pushing, pulling, and tracking
git fetch # gets remote objects and refs. Needed if new branches were added on the remote.
git remote -v # Lists all remotes (verbose)