gcbenison
gcbenison

Reputation: 11963

Compare the index to a commit

I'm looking at a repository with a bunch of files "staged for commit" (i.e. added to the index but not committed yet.) I suspect that the state of the index matches another branch. Before I do a 'reset --hard' or some such, how can I make sure that's the case?

Upvotes: 3

Views: 45

Answers (1)

RyPeck
RyPeck

Reputation: 8147

You want to run a diff on the staged data with the --cached option. To include a branch, just enter the name of the branch.

git diff --cached feature/awesomeness

See man git-diff for more info.

Upvotes: 5

Related Questions