Skip to content

git difftool --no-index option is not respected ("not a git repository" error) when outside a repo #2123

@logan-pugh

Description

@logan-pugh
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.21.0.windows.1
cpu: x86_64
built from commit: 2481c4cbe949856f270a3ee80c802f5dd89381aa
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.17763.316]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Path Option: BashOnly
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Disabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I was not able to reproduce the issue on a Linux VM, so I am posting this here on the Git for Windows issue tracker.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Git Bash

user@machine MINGW64 ~
$ touch a.txt

user@machine MINGW64 ~
$ touch b.txt

user@machine MINGW64 ~
$ git diff --no-index a.txt b.txt

user@machine MINGW64 ~
$ git difftool --no-index a.txt b.txt
fatal: not a git repository (or any of the parent directories): .git
  • What did you expect to occur after running these commands?

I would have expected the git difftool output to match the git diff output.

  • What actually happened instead?

The error fatal: not a git repository (or any of the parent directories): .git was returned.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

N/A (this occurs when current directory is outside of any Git repository)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions