简体   繁体   English

从 bitbucket 克隆 git 存储库时的密码问题

[英]password issue in cloning git repository from bitbucket

I have bitbucket git repository.我有 bitbucket git 存储库。 I tried to clone it from my PC, but I cannot give password.我试图从我的 PC 上克隆它,但我无法提供密码。

git clone https://id@bitbucket.org/id/SOMEGITPROJ.git
Cloning into SOMEGITPROJ...
Password:

As I have this error.因为我有这个错误。

'PASSWORD' is not recognized as an internal or external command,
operable program or batch file.

How to solve this issue?如何解决这个问题? Is there any way to give the password in the same command line of 'git clone command'?有没有办法在'git clone命令'的同一命令行中提供密码?

I found an answer in this site:我在这个网站上找到了答案:

https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html

For mac苹果机

In short:简而言之:

  1. pbcopy < ~/.ssh/id_rsa.pub
  2. go to account/ssh keys to add this key转到帐户/ ssh 密钥以添加此密钥
  3. use ssh protocol not https使用 ssh 协议而不是 https

For PC电脑用

In short:简而言之:

  1. cat /home/USER/.ssh/id_rsa.pub > key.txt
  2. same as Mac和 Mac 一样

For Linux对于 Linux

In short:简而言之:

  1. cat ~/.ssh/id_rsa.pub | xclip -sel clip
  2. same as Mac和 Mac 一样

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM