Ville Walveranta <walveranta <at>> writes:

> "git-rev-parse --is-inside-git-dir" outputs "fatal: Not a git
> repository (or any of the parent directories): .git", instead of
> "false" when outside of a git directory.  "--is-inside-work-tree"
> behaves the same way. Both commands work correctly (i.e. output
> "true") when inside a git directory, or inside a work tree,
> respectively.
> To test, I installed git initially from
> for Ubuntu 12.04.3, and
> then also compiled it from source, but both seem to behave the same
> way. The problem is not yet present in version
> Thanks,
> Ville Walveranta


I thought I'd try to bisect this but I ended up discovering that I get
the exact same behaviour with both and will
also output 'fatal: ...' like does.

Both version will however behave as expected if you provide --git-dir
and --work-tree:

    $ pwd
    $ git --version
    git version
    $ git --git-dir=/home/osse/git/.git \
          --work-tree=/home/osse/git    \
        rev-parse  --is-inside-work-tree

Ditto for --is-inside-git-dir.

Incidentally I discovered that the new -C option does *not* behave this

$ git --version
git version 1.8.5.rc0.23.gaa27064
$ git -C /home/osse/git rev-parse --is-inside-work-tree

But given that the purpose of the -C option is to make Git behave as if
you were in that directory this is perhaps expected behaviour.


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to