4 ms·
> The use of GitHub to show diffs of each step is quite effective. Little off-topic, but that's one of the reasons I like to use Magit on Emacs, you can see th
by mi_lk 8y ago
> The use of GitHub to show diffs of each step is quite effective.
Little off-topic, but that's one of the reasons I like to use Magit on Emacs, you can see the diff of each commit interactively and intuitively.
[1]:https://magit.vc/ https://magit.vc/
- codetrotter 8y agoGit can show you the diff of any commit as well, though I guess maybe the interactivity you mentioned is important. Anyhow, with just git. Diff of most recent commit: git show HEAD Diff of preceding commit: git show HEAD^ Diff of commit before that again git show HEAD^^ Of course you don’t want to type ^ 200 times. Fortunately you don’t have to. Diff of commit three steps back before most recent: git show HEAD~3 Or you can look at the log first git log And find a specific commit and then use the first few characters of the id of that commit, e.g. git show af4c And of course I would be remiss to not mention git diff And git diff --cached These two show you unstaged and staged changes before you commit. I use these commands all the time. So much that they are two of the commands I have created very short two-letter aliases for in my .bashrc alias di="git diff --cached" alias dp="git diff"