Git commands that I always forget but find useful:
# Recover a file:git checkout <previous-commit-hash> <file_path>`# Ignore changes to certain files:git update-index --assume-unchanged config/database.yml
# Take commit from another branch:git cherry-pick <commit reference>
# Delete multiple branches starting with some string:git branch -D `git for-each-ref --format="%(refname:short)" refs/heads/some_string\*`# List branches in order of which most recent commitgit for-each-ref --sort=-committerdate refs/heads/
I tend to alias things so when on another machine it’s handy!