Cannot interact with repo with SSH, only HTTP

Grant Holle April 24, 2017

I have ssh enabled, a key added, and ssh'ing to the server works perfectly fine.

Whenever I try to pull/push with ssh, I get this error:

fatal: '/ad/isc-admissions.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
and the repository exists.

I know that the repo does exist and I have access to it. I am, however, able to push/pull via http and my password.

What am I doing wrong?

 

2 answers

1 accepted

2 votes
Answer accepted
Grant Holle May 18, 2017

The problem was that my SSH settings in Bitbucket matched the SSH port for the server. Bitbucket manages its SSH separately.

Changing the port setting resolved the issue.

1 vote
Steve Thornhill
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2017

What do you have set for pushing?

git remote -v

Or alternatively which commands are you using when performing the actions via http vs ssh

Grant Holle April 26, 2017
$ git remote -v
bitbucket ssh://git@server.com:10022/ad/isc-admissions.git (fetch)
bitbucket ssh://git@server.com:10022/ad/isc-admissions.git (push)

We ssh through 10022. 

Same commands when using http or ssh.

$ git fetch bitbucket master
fatal: '/ad/isc-admissions.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
and the repository exists.

When I remove that remote and add the http url, it works fine after I authenticate with my password.

Grant Holle April 26, 2017

The url for http has a different path and user compared to ssh.

http://grant@server.com:7990/scm/ad/isc-admissions.git
ssh://git@server.com:10022/ad/isc-admissions.git

I've added the git user's ssh key to the repo with the same results. My key is added to the git user's as well. I can ssh into the server as git no problem.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events