Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal: ''<path>'' does not appear to be a git repository #1237

Closed
luckerby opened this issue Aug 23, 2018 · 10 comments
Closed

fatal: ''<path>'' does not appear to be a git repository #1237

luckerby opened this issue Aug 23, 2018 · 10 comments

Comments

@luckerby
Copy link

"OpenSSH for Windows" version
7.7.2.0

Server OperatingSystem
Windows Server 2016 Standard

Client OperatingSystem
Windows 10 Version 1803 (OS Build 17134.167)

Expected output
$ git clone user@opensshserver:c:/ScriptRepo
Cloning into 'ScriptRepo'...
remote: Counting objects: 10, done.
remote: Total 10 (delta 0), reused 0 (delta 0), pack-reused 10
Unpacking objects: 100% (10/10), done.

Actual output
$ git clone user@opensshserver:c:/ScriptRepo
Cloning into 'ScriptRepo'...
fatal: ''c:/ScriptRepo'' does not appear to be a git repository
fatal: Could not read from remote repository.

This issue has been discussed previously here, and the mentioned workaround works just fine once a remote is created. However this needs to be applied on each client machine, and it also prevents simple commands such as git clone - given that the setting of invoking powershell along with git-upload-pack can only be done once the remote has been created. Is there a plan to have this fixed, or is a way to specify the "default shell" that's "passed" along as being Powershell, thus solving the double single-quote issue ?

@luckerby luckerby changed the title fatal: ''<path'' does not appear to be a git repository fatal: ''<path>'' does not appear to be a git repository Aug 23, 2018
@bingbing8
Copy link
Contributor

@luckerby, as far as I remember, powershell can interpret the single quoted string. If you config powershell as default shell on the server side, I expect that you don't need to apply the workaround.

@bingbing8
Copy link
Contributor

bingbing8 commented Sep 21, 2018

@luckerby, I tried to set the defaultShell, no need to apply the workaround:
image

git clone remoteMachine:D:\test\mytest.git
Cloning into 'mytest'...
domain\user@localhost's password:
warning: You appear to have cloned an empty repository.

@doggy8088
Copy link

doggy8088 commented Oct 12, 2018

@bingbing8 I tried your workaround. The server return:

fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly

I turned on debugging environment variables and git clone again:

set GIT_TRACE_PACKET=1
set GIT_TRACE=1
set GIT_CURL_VERBOSE=1
git clone user@ip.add.ress:c:/456.git

I've got this:

19:21:03.324897 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
19:21:03.325880 git.c:415               trace: built-in: git clone user@ip.add.ress:c:/456.git
Cloning into '456'...
19:21:03.369851 run-command.c:637       trace: run_command: unset GIT_DIR; ssh user@ip.add.ress 'git-upload-pack '\''c:/456.git'\'''
user@ip.add.ress's password:
19:21:17.086565 pkt-line.c:80           packet:        clone< 5305d8945047e26d4fc6005768f3478a22be6d79 HEAD\0multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed symref=HEAD:refs/heads/master agent=git/2.19.1.windows.1
19:21:17.086565 pkt-line.c:80           packet:        clone< 5305d8945047e26d4fc6005768f3478a22be6d79 refs/heads/master
19:21:17.086565 pkt-line.c:80           packet:        clone< 0000
19:21:17.095052 pkt-line.c:80           packet:        clone> want 5305d8945047e26d4fc6005768f3478a22be6d79 multi_ack_detailed side-band-64k thin-pack ofs-delta deepen-since deepen-not agent=git/2.19.1.windows.1
19:21:17.095052 pkt-line.c:80           packet:        clone> want 5305d8945047e26d4fc6005768f3478a22be6d79
19:21:17.095052 pkt-line.c:80           packet:        clone> 0000
19:21:17.095052 pkt-line.c:80           packet:        clone> done
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly

Do you know what's going on?

@bingbing8
Copy link
Contributor

@doggy8088, setting to powershell works for me.

@luckerby
Copy link
Author

luckerby commented Nov 2, 2018

@luckerby, I tried to set the defaultShell, no need to apply the workaround:
image

git clone remoteMachine:D:\test\mytest.git
Cloning into 'mytest'...
domain\user@localhost's password:
warning: You appear to have cloned an empty repository.

@bingbing8, sorry for the late reply. Your solution works perfectly - just tested. Extra bonus point - Jenkins can now connect to OpenSSH for git integration; I wouldn't have been able to apply the previous workaround in the Jenkins git dialog.

@shishelmishel
Copy link

shishelmishel commented Oct 4, 2019

@doggy8088, i have a same problem after install PowerShell as a default shell, it is not work :(
I have trying different shells and /usr/bin/bash.exe from "git for Windows" packet works fine!
Hope it helps someone

@EdwinCloud101
Copy link

I didn't try with PowerShell as suggested, I'm sure it works. However, I would like to keep using GitBash and be able to make the clone remote work. Any direction is appreciated.

@vito0719
Copy link

My problem is this:

fatal: '/F:/Path/To/Repo.git' does not appear to be a git repository

It seems to me the "/" before F is the problem...

Why are you able to use "git clone user@opensshserver:c:/ScriptRepo"? I have to put "/" in front of my drive to connect...

@luisd1360
Copy link

Hello, I tried to change the defaultshell to powerShell but every time I did the service stoped working, then It did not work again until I change the registry back and rebooted.

@maertendMSFT
Copy link
Collaborator

We recommend using PowerShell, or if you need to use Bash, use the copy of SSH that comes with git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants