LoginSignup
1
0

BitbucketからLinuxサーバにgitをclone

Posted at

手順は以下

  1. bitbucket用のssh鍵作成
  2. bitbucketにssh公開鍵を登録
  3. linuxの.ssh/configにssh接続用情報を登録
  4. gitをinit
  5. gitをclone

1. bitbucket用のssh鍵作成

[prompt] # cd ~/.ssh
[prompt] # mkdir bitbucket
[prompt] # cd ~/.ssh/bitbucket
[prompt] # ssh-keygen -t rsa -C メールアドレス
[prompt] # cmhod 600 id_rsa

2. bitbucketにssh公開鍵を登録

出来上がった公開鍵「~/.ssh/bitbucket/id_rsa.pub」をbitbucketに登録する

3. linuxの.ssh/configにssh接続用情報を登録

[prompt] vim ~/.ssh/config
--
Host bitbucket.org
    User git
    Port 22
    HostName bitbucket.org
    identityFile ~/.ssh/bitbucket/id_rsa
    TCPKeepAlive yes
    IdentitiesOnly yes

4. gitをinit

[prompt] # cd
[prompt] # mkdir git
[prompt] # cd git
[prompt] # git init

5. gitをclone

[prompt] # git clone git@bitbucket.org:******/selecttype.git
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0