Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set git diff to a default value

Tags:

git

diff

I previously changed my git diff tool with git config --global diff.external <diff-tool-name>. I decided I don't like that tool and wanted to switch back.

I tried meddling around and did something like: git config --global diff.external git-diff. Now calling git diff to see unstaged changes yields:

fatal: ambiguous argument '48e66b706d21398f28240810e7fc0d44d8f92d99': unknown revision or path not in the working tr Use '--' to separate paths from revisions external diff died, stopping at somefile.ext. 

How do I set my git diff command to use the default command line git diff that came with git. Something like:

git config --global diff.

and then what?

like image 905
axel22 Avatar asked Feb 10 '11 10:02

axel22


People also ask

What does git diff compare by default?

By default git diff will execute the comparison against HEAD . Omitting HEAD in the example above git diff ./path/to/file has the same effect. When git diff is invoked with the --cached option the diff will compare the staged changes with the local repository.

What is true git diff?

Git diff is a command-line utility. It's a multiuse Git command. When it is executed, it runs a diff function on Git data sources. These data sources can be files, branches, commits, and more.

What is A and B in git diff?

In most cases, Git picks A and B in such a way that you can think of A/- as "old" content and B/+ as "new" content. Let's look at our example: Change #1 contains two lines prepended with a "+". Since no counterpart in A existed for these lines (no lines with "-"), this means that these lines were added.

What is git diff format?

According to the official Git documentation, git diff is used to: “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.”


1 Answers

Try
git config --global --unset diff

and

git config --global --unset diff.external

See the explanation of git config for further details.

like image 104
eckes Avatar answered Sep 23 '22 15:09

eckes