Hawkwinter
Hawkwinter

Reputation: 31

Git Extensions for Windows: "could not create work tree dir" "Invalid argument"

First attempt trying to figure out Git & GitHub. Using Git Extensions on Windows. Fresh install. I made an SSH Key pair, put the public key in a Github account I just made, and loaded the private key before trying to clone a repo.

It doesn't seem to matter what repo I try to clone, I keep getting the same error, and I don't know why.

"git" clone -v --recurse-submodules --progress "https://github.com/astranauta/5etools.git" "H:/GIT/astranauta/5etools/5etools"
fatal: could not create work tree dir 'H:/GIT/astranauta/5etools/5etools"': Invalid argument

Done

Press Enter or Esc to close console...

Upvotes: 3

Views: 13731

Answers (4)

ARMall
ARMall

Reputation: 11

If you've arrived here working with a PowerShell, especially trying to clone a local repo, this may help you.

PowerShell autocompleted my local repository path with a trailing \ that I had to remove.

e.g. git clone "<dir to>\<git repository folder>\" should be git clone "<dir to>\<git repository folder>"

Hope that helps someone.

Upvotes: 1

Sharryy
Sharryy

Reputation: 254

In my case the problem was with repositry name e.g I mistakenly added one extra . to the end of repositry name while creating repositry. The name was like CRUD-With-GraphQL..git. So the . before .git was the actual issue. I renamed my repositry, removed the extra . and the problem was resolved.

Upvotes: 4

Philippe
Philippe

Reputation: 31227

I think that the problem come from an optional component of GitExtensions called "Conemu". It perhaps will fail at other moments... Could you try to disable it using this documentation :

https://git-extensions-documentation.readthedocs.io/en/latest/settings.html#advanced-general-use-console-emulator-for-console-output-in-command-dialogs

Upvotes: 0

VonC
VonC

Reputation: 1328522

As a workaround, try, in a regular CMD with git in your %PATH%:

cd H:\GIT\astranauta\5etools
git clone -v --recurse-submodules --progress https://github.com/astranauta/5etools.git

No need for double-quotes around git.

If you were in a git bash, I would have tried

git clone -v --recurse-submodules --progress https://github.com/astranauta/5etools.git /H/GIT/astranauta/5etools/5etools

Again, there shouldn't be any double-quotes, unless you have spaces in the path.

Upvotes: 0

Related Questions