无法在Ubuntu上克隆来自bitbucket的repo

时间:2016-03-14 05:05:30

标签: git ubuntu bitbucket

我正在尝试在Ubuntu上克隆来自Bitbucket的回购,但它失败了:

fatal: https://user@bitbucket.org/owner/repo.git/info/refs not valid: is this a git repository?

但是,如果我在Mac上执行完全相同的命令,它可以正常工作。

我使用的命令是:

git clone https://user@bitbucket.org/owner/repo.git

Ubuntu上可能出现什么问题?

2 个答案:

答案 0 :(得分:5)

使用 LIBS += -Wl,--start-group LIBS += -L/usr/local/lib -static -lopencv_core -lopencv_imgcodecs -lopencv_highgui -lopencv_videoio -lopencv_imgproc LIBS += -L/usr/lib -lflycapture -lflycapture-c -lflycapturegui LIBS += -Wl,--end-group 协议代替 ssh

使用http / https,每次必须与服务器“对话”时都必须输入密码。

使用ssh将使用http/https,您不必每次都输入用户名密码。

ssh keys

git clone git@bitbucket.org:owner/repo.git

您收到此错误,因为您的任何平台上都没有ssh密钥。 设置密钥,将其添加到您的帐户,您就可以开始使用了。

Permission denied (publickey)

Create ssh keys

# create the key pair. ssh-keygen -t rsa # echo the key (pub) to the screen and copy it to clipboard cat ~/.ssh/id_rsa.pub

  • 登录您的Bitbucket帐户
    选择头像>应用程序菜单中的设置。

  • 选择SSH密钥并粘贴您从第一步中复制的密钥

enter image description here

注意:

在需要连接帐户的每台计算机上重复此步骤,或将相同的密钥复制到所有计算机上。这两种方式都有效。

答案 1 :(得分:0)

我认为该命令可以是https

git clone https://bitbucket.org/owner/repo.git

或ssh

git clone git@bitbucket.org:owner/repo.git