Skip to content

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

Closed

Description

"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 ?

Activity

  1. changed the title [-]fatal: ''<path'' does not appear to be a git repository[/-] [+]fatal: ''<path>'' does not appear to be a git repository[/+] on Aug 23, 2018
  2. bingbing8 commented on Sep 21, 2018

    @bingbing8
    Contributor

    Mihai Albert (@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.

  3. bingbing8 commented on Sep 21, 2018

    @bingbing8
    Contributor

    Mihai Albert (@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.
    
  4. doggy8088 commented on Oct 12, 2018

    @doggy8088

    Yanbing (@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 [email protected]: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 [email protected]:c:/456.git
    Cloning into '456'...
    19:21:03.369851 run-command.c:637       trace: run_command: unset GIT_DIR; ssh [email protected] 'git-upload-pack '\''c:/456.git'\'''
    [email protected]'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?

  5. bingbing8 commented on Oct 17, 2018

    @bingbing8
    Contributor

    Will 保哥 (@doggy8088), setting to powershell works for me.

  6. luckerby commented on Nov 2, 2018

    @luckerby
    Author

    Mihai Albert (@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.
    

    Yanbing (@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.

  7. shishelmishel commented on Oct 4, 2019

    @shishelmishel

    Will 保哥 (@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

  8. EdwinCloud101 commented on Nov 24, 2019

    @EdwinCloud101

    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.

  9. vito0719 commented on Feb 20, 2020

    @vito0719

    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...

  10. luisd1360 commented on Feb 23, 2020

    @luisd1360

    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.

  11. maertendMSFT commented on Apr 28, 2020

    @maertendMSFT
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions