-
Recursively remove all untracked files in the tree.
- Command:
git clean -f
- Command:
-
Throw out all of your changes to existing files, but not new ones.
- Command:
git reset --hard
- Command:
-
Remove file from staging area.
- Command:
git rm --cached [file]
- Command:
-
See diff of files in the staging area.
- Command:
git diff --staged
- Command:
-
See tracked files.
- Command:
git ls-files
- Command:
-
See a branch graph.
- Command:
git log --graph
- Command:
-
See all tags.
- Command:
git tag
- Command:
-
See a list of deleted files.
- Command:
git ls-files -d
- Command:
-
Restore all deleted files.
- Command:
git ls-files -d | xargs git checkout --
- Command:
-
View commits not yet pushed to remote.
- Command:
git log --branches --not --remotes
- Command:
-
Difference between two branches.
- Command:
git diff --stat --color master..branch
- Command:
-
See a list of all objects.
- Command:
git rev-list --objects --all
- Command:
-
Remove file from index.
- Command:
git rm --cached filename.txt
- Command:
-
Get a list of all commit messages for a repo.
- Command:
git log --pretty=format:'%s'
- Command: