LoginSignup
3
6

More than 5 years have passed since last update.

Bitbucketでの新規リポジトリ作成メモ

Posted at

久しぶりにやったら忘れてたのでメモ。
特にssh周り覚えてなかった\(^o^)/

下準備

※Bitbucketのアカウントはあるものとする(そりゃそうだ)

①Bitbucket上でリポジトリを作る

作る。

②鍵ファイルを作る

cd ~/.ssh
ssh-keygen -t rsa -C [メアド的なもの]

③公開鍵をBitbucketにコピー

catコマンド等でid_rsa.pubを表示してコピー。
それをBitbucketのアカウントの方に鍵を追加する。
※リポジトリごとに設定するのは間違い→http://personal.loudandproud.me/bitbucket-ssh-read-only/

④パーミッションを600にする

mv ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 600 ~/.ssh/id_rsa 

Gitの設定

Gitの設定を行う。

リポジトリの設定

cd [管理したいディレクトリ]
git init
git remote add origin [リポジトリURL]

※Bitbucket見ながらでも設定できるはず

好きな設定

好きな設定を施す。
Gitのカラーリングはglobalでやってるので今回はしない…。

git config --global user.name [名前]
git config --global user.email [email]
git config --local core.quotepath false

pushする

git add .
git commit -m "first commt"
git push origin master

で完了。

3
6
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
3
6