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

git clone always give error message,fatal: ''mongodb'' does not appear to be a git repository, with a wired double quotes #400

Open
tbxy09 opened this issue Nov 9, 2016 · 12 comments

Comments

@tbxy09
Copy link

tbxy09 commented Nov 9, 2016

$ git clone ssh://[email protected]:mongodb
Cloning into 'mongodb'...
[email protected]'s password:
fatal: ''mongodb'' does not appear to be a git repository ---------------this is the wrong output of git-upload pack, git clone will call the git-upload-pack in remote server
fatal: Could not read from remote repository.

BUT I TRIED THIS ,IT WORKS

$ ssh [email protected] "git-upload-pack mongodb"
[email protected]'s password:
0000----------------this is a right ouput is git-upload-pack

I found instead of single quotes of ''mongodb''in err msg ---fatal: ''mongodb'' does not appear to be a git repository---, gives a wired double quotes, and I tried in local the 'git-upload-pack' command, it only give single quote in its err msg.

I think something wrong when transferring the repo path to ssh remote server, shoud be caused by the openssh

@tbxy09 tbxy09 changed the title do git clone always give error message,fatal: ''mongodb'' does not appear to be a git repository, with a wired double quotes Nov 9, 2016
@arif-pragmasys
Copy link
Contributor

Similar to #389

@arif-pragmasys
Copy link
Contributor

arif-pragmasys commented Dec 5, 2016

Looks like if I do not mention any protocol, git is picking up ssh and cloning works fine.
image

But if ssh is mentioned as protocol it does not work. I tired it on Linux using openssh. So it might be issue related with git command itself.
image

The git documentation says ssh is supported though.

image

@Aigeec
Copy link

Aigeec commented Feb 23, 2017

I am having a similar issue as the op.

I have a bare git repo in a test directory in my users (named git) homes folder.

I have ssh running using OpenSSH-Win64. When I run git clone on another windows pc I get a similar message

git clone git@server:test

(Separate issue here when using ssh url format instead of scp format that you can't use a relative path as it will put / in front of your path)

"fatal: ''test'' does not appear to be a git repository"

I upped the ssh logging and can see this is output:

Executing command: E:\\Tools\\OpenSSH-Win64\\ssh-shellhost.exe -nopty Z2l0LXVwbG9hZC1wYWNrICd0ZXN0Jw==

Decoding the Z2l0LXVwbG9hZC1wYWNrICd0ZXN0Jw== gives "git-upload-pack 'test'"

If I run that command locally I get the same error. However if I remove the single quote or replace them with double the command works.

I don't think it is possible to get windows command prompt to recognise single quotes as a quote character.

Suggestions:

Optionally use sh/powershell instead of cmd.exe. Maybe just default to powershell it's ok with single quotes.

GOTO_CLEANUP_ON_ERR(wcscat_s(cmd, MAX_CMD_LEN, L"cmd.exe"));

https://github.com/PowerShell/Win32-OpenSSH/blob/L1-Prod/contrib/win32/win32compat/shell-host.c line 978.

Replace single quotes with doubles prior to line 987

https://github.com/PowerShell/Win32-OpenSSH/blob/L1-Prod/contrib/win32/win32compat/shell-host.c line 987

@bagajjal
Copy link
Collaborator

Please try with the recent release (0.0.9.0).. I think this should be fixed..

@Aigeec
Copy link

Aigeec commented Feb 24, 2017

I've checked and I am on that 0.0.9.0 version.

BTW is there an easy way of finding what version you are on. It's not on the downloaded artefact or in the ssh_config and there doesn't seems to be a readme in the output.

A

@bagajjal
Copy link
Collaborator

is it working on 0.0.9.0 version?

Thanks for the suggestion, we will add a way to find the version.

@Aigeec
Copy link

Aigeec commented Feb 24, 2017

The issue I had above was with the 0.0.9.0 version.

A

@asinno
Copy link

asinno commented Mar 22, 2017

We are having the same issue with the most up to date version...

@manojampalam
Copy link
Contributor

Use this to retrieve product version:
(get-item .\sshd.exe).VersionInfo.FileVersion

@asinno
Copy link

asinno commented Mar 22, 2017

I am using 0.0.10.0 according to the command I just ran. Are there any current workarounds?

@asinno
Copy link

asinno commented Mar 22, 2017

PS C> git clone user@serverA:Z:/gitrepo.git
Cloning into 'gitrepo.git'...
user@serverA's password:
fatal: ''Z:/gitrepo.git'' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

It appears I am also getting the double single quotes '' instead of "

@naloqab
Copy link

naloqab commented Apr 15, 2019

This by far is the easier way to get around the double quote issue:
powershell New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Program Files\Git\bin\bash.exe" -PropertyType String -Force
This changes the default OpenSSH shell to bash.

@manojampalam manojampalam removed this from the Integration to OpenSSH Portable milestone May 21, 2019
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

8 participants