(You can't use this with git difftool or merge though)
git diff --ignore-space-at-eol
Got a conflict during a merge? Know that you only care about the file in the other branch?
git checkout --theirs file/that/has/conflict
Know that yours is the correct one?
git checkout --ours file/that/has/conflict
Want to merge but know that you want your files to win any conflicts?
git merge -s recursive -X ours
git commit --amend -m "New commit message"
git add forgotten_file other_forgotten_file ...
git commit --amend
git stash save "Nearly finished the blah feature, but have to fix yak first"
git stash show stash@{1}
git diff some_branch:spec/blueprints.rb stash@{1}:spec/blueprints.rb
# git difftool stash@{1}
# would diff the whole current branch against the stash,
# you probably just want the diffs of the files in the stash
for file in `git stash show --name-only stash@{1}`; do git difftool your_branch:$file stash@{1}:$file; done
git checkout stash@{1} -- path/of/file/in/stash.rb
# note, can also pass multiple files to get them all at once
# git checkout stash@{1} -- path/of/file/in/stash.rb path/to/file2.txt path/to/another/file.jpg
# When you diff you can look at the files committed in HEAD, versus those on disk
#
# on disk:
git diff stash@{0}:spec/blueprints.rb spec/blueprints.rb
# in HEAD:
git diff stash@{0}:spec/blueprints.rb HEAD:spec/blueprints.rb
# staged:
git diff stash@{0} -- spec/blueprints.rb
# this omission of the filename and the separation with -- from the stash works with the other examples too
# You're working in feature/my-branch and you want to merge from master
#
# git fetch origin master
# git difftool feature/my-branch...origin/master
#
# Note the three ...
# Without them you're comparing? which is a different thing entirely
# if it's all looking good, then git merge origin master