【4日目】【1日20分のRailsチュートリアル】サンプルアプリのGitリポジトリをBitbucketにpushした
今日はGitリポジトリをBitbucketにpushします。
なくてもいいけど、バックアップも兼ねて、的な。
1.4.3 Bitbucket
Bitbucketのユーザー登録して、Cloud9の公開鍵Bitbucketに設定する。
公開鍵を表示させて、
$ cat ~/.ssh/id_rsa.pub
BitbucketでSSHキーを登録する。
「アカウントの管理」>「SSHキー」
「Label」はなんでも良さそうなので「Cloud9」にしました。
「Repository name」は「hello_app」に。
作成したリポジトリにサンプルアプリのソースコードをpushする。
push用のコマンドは「既にプロジェクトがあります」をクリックすると表示される。
タグ付けは要らないかな、と思ったので最後の行はなしで下記コマンドを実行。 Bitbucketのユーザー名によって2行目のコマンドは異なるので注意。
$ cd hello_app/ $ git remote add origin git@bitbucket.org:kz-sue/hello_app.git $ git push -u origin --all Warning: Permanently added 'bitbucket.org,104.192.143.2' (RSA) to the list of known hosts. Counting objects: 64, done. Delta compression using up to 8 threads. Compressing objects: 100% (53/53), done. Writing objects: 100% (64/64), 16.20 KiB | 0 bytes/s, done. Total 64 (delta 2), reused 0 (delta 0) To git@bitbucket.org:kz-sue/hello_app.git * [new branch] master -> master Branch master set up to track remote branch master from origin.
pushが完了すればBitbucketでソースコードが確認できる。(コミットも)
1.4.4 ブランチ (branch)、変更 (edit)、 コミット (commit)、マージ (merge)
READMEファイルの更新をしながらgitコマンドの使い方を覚える項。
ここに時間は掛けたくないのでさらっと読むだけにした。
今日の作業時間は【24分】でした。
次は「1.5 デプロイする」から。