Git Cheat Sheet

Stash

git stash [save]stores your local changes away and revert them to the baseline

git stash pop – retrieves changes stored via git stash, removes them from the storage and applies to the local copy using merge.

git stash applyretrieves changes stored via git stash (without removing from storage) and merges them to the local copy.

git stash dropdrops the currently stashed changes from the storage.

Resolving conflicts

git add "fileWithResolvedConflicts"Declares that all conflicts have been resolved in file fileWithResolvedConflicts.

Tags

git taglist the tags

git tag Xsets the X tag

git tag -a “version” -m “messagesets a tag named “version” with a commit message

git tag -d Xremoves the tag X

git push --tagspushes all the tags

git push origin Xpushes tag X.

Log

git logshow the commit/tag log

git log --name-statusshows the log with changed files