Last active
December 9, 2016 11:53
-
-
Save nadeem-khan/9ece50ad4a037a6f5065 to your computer and use it in GitHub Desktop.
Git Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log -n 2 | |
git log --since=2012-06-15 | |
git log --until=2012-06-15 | |
git log --author="Nadeem" | |
git log --oneline | |
git log SHA1..SHA2 --oneline | |
git log SHA..index.html | |
git log --format=short | |
git show SHA | |
git show --format=online HEAD | |
git diff -b SHA1.HEAD (-b for ignoring spaces ... -w for ignoring all spaces) | |
git diff | |
git commit -am "when editing the most recent commit message" | |
cd .git/refs/heads then cat master (HEAD POINTER) | |
git diff --color-words index.php | |
git revert SHA | |
git reset --soft (--mixed OR --hard) | |
git clean -n | |
git clean -fd (force all files to get trashed that aren't tracked) | |
git rm --cached file.txt (keeps in working copy, all others deleted and stops tracking it) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment