0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Bitbucket初めてのリモートリポジトリ

Last updated at Posted at 2021-02-06

初投稿になります。
RailsチュートリアルでのBitbucketへリモートリポジトリする流れをメモします。

1.公開鍵を作成する
・下記のコマンドを実行すると鍵が現時点で存在するかどうか分かる。ない場合は何も出ない。

$ cd ~/.ssh
$ ls
authorized_keys2  id_dsa      (この辺に鍵が出る)
config            id_dsa.pub

・秘密鍵(id_rsa)
・公開鍵(id_rsa.pub)

鍵がない場合は鍵の作成が必要
ssh-keygenの後、パスワード設定を求められる。何も入力しなくてもOK

$ ssh-keygen

自分の公開鍵を表示(結構長い)
・出力したファイルの中身をコピー

$ cat ~/.ssh/id_rsa.pub

詳しくはGitのサイトをご覧ください

2.Bitbucketで設定
・アバター画像をクリック、Personal settings、SSH 鍵、の順に選択。先程コピーした鍵を張り付け
・その後リポジトリを作成
・画面真ん中のURLをコピー git@〜 みたいなやつ
(注意 git clone git@〜 のgit cloneはコピーしない)
Bitbucketはこちら

3.ターミナルでの設定

$ git remote add origin git@(BitbucketからコピーしてきたURL)

$ git push -u origin --all

これでOK!

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?