N. P. O'Donnell, 2020
List all commits on all remotes:
for c in $(git rev-list --remotes); do git show $c | head -n8; done | lessCommit with empty commit message
git commit --allow-empty-message -m ""Remove untracked files (dryrun):
git clean -d -nRemove untracked files (for real):
git clean -d -fNext commit:
function n() {
git log --reverse --pretty=%H master | grep -A 1 $(git rev-parse HEAD) | tail -n1 | xargs git checkout
}Previous commit:
function p() {
git checkout HEAD^1
}View the reflog:
git reflogRevert to a point in the reflog (e.g.: HEAD@{10}):
git reset --hard HEAD@{10}