Quote:
Originally Posted by Grue
I know how to do a git diff but that involves tediously finding and copy and pasting giant commit hashes after a git log and then hitting space x number of times to hopefully find what you want as opposed to clicking on the file. Checking out a commit in sourcetree is double clicking as opposed to more copy paste of hashes.
1. You don't need to ever mess around with the long git hash. Look at `git log --oneline`. Better, `git log --decorate --pretty --oneline` is what I use. You can get away with the 7 character one.
2. You can specify the commits relative to HEAD, e.g. `git diff HEAD~5 HEAD~3`. Use an alias to abbreviate this.
3. If the old commit is a branch, you can use name the branch, e.g. `git diff master HEAD~3`. Use tab complete on branch names.
4. New commit defaults to HEAD, so you don't have to specify it if that's what you want, e.g. `git diff master HEAD` is the same as `git diff master`
But as I already mentioned to suzzer, I look at big diffs (e.g. merge requests) in Gitlab, and side-by-side, which is not something the cli can do natively to my knowledge.