0 votes
1 view
in Devops and Agile by (25k points)

How do I show uncommitted changes in Git?

I SFTW'ed, and those commands do not work.

[email protected] MINGW64 /d/nano/repos/PSTools/psservice (bhamra/psservice)

$ git status

On branch bhamra/psservice

Your branch is up-to-date with 'origin/bhamra/psservice'.

Changes to be committed:

  (use "git reset HEAD <file>..." to unstage)

        modified:   psservice.c

        modified:   psservice.vcxproj.filters

[email protected] MINGW64 /d/nano/repos/PSTools/psservice (bhamra/psservice)

$ git diff

[email protected] MINGW64 /d/nano/repos/PSTools/psservice (bhamra/psservice)

$ git diff master

fatal: ambiguous argument 'master': unknown revision or path not in the working tree.

Use '--' to separate paths from revisions, like this:

'git <command> [<revision>...] -- [<file>...]'

1 Answer

+1 vote
by (63.3k points)

The command you're searching for is git diff.

git diff - Shows changes between different commits like their commit ID, commit and working tree, etc

Here are some of the choices it exposes that you can use

git diff (no parameters)

Print out differences between your working directory and the index.

git diff --cached:

Print out variations between the index and HEAD (current commit).

git diff HEAD:

Print out differences between your working directory and the HEAD.

git diff --name-only

Show only names of changed files.

git diff --name-status

Show only names and status of changed files.

git diff --color-words

Word by word diff rather than line by line.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...