Your branch is ahead of by x commits – what’s changed?

So you do a git status and you see:

On branch my/branch
Your branch is ahead of 'your branch' by x commits.
(use "git push" to publish your local commits)

nothing to commit, working tree clean

How do you check to see what you’ve changed (i.e. local and remote)?

TLDR: use tig (option 4).


1. git log

git show <sha1>


2. This isn’t much use: git diff. E.g.

git diff origin/my/branch

and then you’ll end up with gibberish like:

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4dd7ebf
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@

which you can tortuously pick apart line by line. E.g. I especially like the easy-to-read @@ -0,0 +1,2 @@ – immediately obvious!

3. You can use Visual Studio Code (if installed) with code .

But when I tried, this didn’t seem to pick up what my commits were.


4. tig is awesome

See the manual ( e.g. for key shortcuts.




Leave a Reply

Your email address will not be published. Required fields are marked *