git-ecosystem/git-credential-manager

"git clone" yields error "fatal: --local can only be used inside a git repository"

jazzdelightsme opened this issue · 5 comments

Using git.exe 2.44.0.1, a very simple git clone call:

git clone --quiet --depth 1 $Source $cloneDest

yielded an unexpected error:

fatal: --local can only be used inside a git repository

The clone apparently succeeded (we got the files on disk), but the error looks very concerning ("fatal"!).

Downgrading to git 2.43 makes the error go away.

Derrick Stolee helped us isolate this to GCM--attached is a trace (using GIT_TRACE2_PERF=1) that he captured for us. He hypothesized:

It's possible that there was a change in GCM but also it could be a change in upstream Git that changed the timing of these GCM calls that think they can update the credentials.

Also, the --quiet, --depth 1, and $cloneDest parts of your command are not necessary to reproduce this problem.

trace-results.txt

Curiously, I was not able to repro (git version 2.44.0.windows.1)... but apparently Derrick was. Perhaps I already had credentials cached?

Honestly when I pushed back it it came off when I was looking for it the credits should be there

git clone --quiet --depth 1 $Source $cloneDest

fatal: --local can only be used inside a git repository

Curiously, I was not able to repro (git version 2.44.0.windows.1)... but apparently Derrick was. Perhaps I already had credentials cached?

Sorry, I was on 2.44.0.vfs.0.1 I think.

This error should be fixed in #1561

The next release of GCM should include this fix.