Search code examples
gitbashgit-stash

How view recent changes to local repo in Git?


I'm working off of a big repo with lots of files. I've made minor changes in a lot of them (and haven't committed anything) and would like to be able to cycle through the history of changes to see exactly what was changed; similar to what happens if you use the git stash -p command. Is this possible?

Pretty much: I changed a lot of little things in different files and then something broke and I'm trying to figure which was the change that threw it all off.


Solution

  • Assumptions:

    • you haven't committed anything
    • you don't want to use a GUI

    Options:

    • git status tells you what you've changed (obviously)
    • git diff (which tells you what would be staged if you did a git add
    • git diff [branchname/commit] (which tells you the difference between the working tree and the branchname/commit - so git diff HEAD or git diff master are useful)
    • Add --patch if you want a patch file
    • Add --stat if you want stats.