

Git diff -cached $(git merge-base A HEAD). If -merge-base is given, instead of using, use the merge base of and HEAD. unborn branches) and is not given, it shows all staged changes.

Typically you would want comparison with the latest commit, so if you do not give, it defaults to HEAD. This form is to view the changes you staged for the next commit relative to the named. Option when running the command in a working tree controlled by Git and at least one of the paths points outside the working tree, or when running the command outside a working tree controlled by Git. This form is to compare the given two paths on the filesystem.

Tell Git to further add to the index but you still haven't. In other words, the differences are what you This form is to view the changes you made relative to the index (staging area for the next commit). Show changes between the working tree and the index or a tree, changes between the index and a tree, changes between two trees, changes resulting from a merge, changes between two blob objects, or changes between two files on disk. Git-diff - Show changes between commits, commit and working tree, etc
