Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在bitbucket上使用git和ssh_Git_Macos_Ssh - Fatal编程技术网

如何在bitbucket上使用git和ssh

如何在bitbucket上使用git和ssh,git,macos,ssh,Git,Macos,Ssh,我想通过ssh连接在bitbucket上使用git,但git clone返回致命错误 我创建了一个名为sshtest的存储库,我确信使用了正确的ssh密钥,因为我使用了下面的ssh命令来确认它 你有什么想法来提出这个错误吗 $ ssh -T git@bitbucket.org # show nothing $ ssh git@bitbucket.org PTY allocation request failed on channel 0 logged in as username. You

我想通过ssh连接在bitbucket上使用git,但
git clone
返回致命错误

我创建了一个名为sshtest的存储库,我确信使用了正确的ssh密钥,因为我使用了下面的ssh命令来确认它

你有什么想法来提出这个错误吗

$ ssh -T git@bitbucket.org # show nothing
$ ssh git@bitbucket.org 
PTY allocation request failed on channel 0
logged in as username.

You can use git or hg to connect to Bitbucket. Shell access is disabled.
Connection to bitbucket.org closed.

$ git clone git@bitbucket.org:username/sshtest.git
Cloning into 'sshtest'...
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我用我自己的Bitbucket帐户、测试回购和密钥复制了您概述的步骤,并且它没有任何问题:

[ville@UBUNTU16-ORBITER:~/Projects] [16:37 CST]
# git clone git@bitbucket.org:vwal/testrepo.git            
Cloning into 'testrepo'...
Enter passphrase for key '/home/ville/.ssh/keys/gitkey/gitkey': 
remote: Counting objects: 65, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 65 (delta 17), reused 0 (delta 0)
Receiving objects: 100% (65/65), 4.85 KiB | 0 bytes/s, done.
Resolving deltas: 100% (17/17), done.
[ville@UBUNTU16-ORBITER:~/Projects] [16:38 CST]

这让我觉得Bitbucket端的存储库访问设置仍然有问题(配置了用户后,您可以连接到Bitbucket,就像在测试中一样,但不能连接到特定的存储库)。您确定已为访问用户名提供对Bitbucket中的
sshtest
存储库的足够访问权限吗?您可以访问Bitbucket中的存储库,然后选择设置>用户和组访问权限,并至少为访问用户名提供读取权限。

感谢您提供的信息。
sshtest
存储库是我自己的存储库,所以我有一个管理员权限,设置为“username已经有访问权限”。奇怪的是,我可以通过带有ssh身份验证的sourcetree从windows克隆存储库。