1
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 5 years have passed since last update.

bitbucketを使ったリモートリポジトリ作成(サーバー 上のローカルリポジトリと同期)

Posted at

#1. bitbucketでリポジトリ作成
#2. bitbucketのリモートリポジトリとローカルリポジトリを接続

$ git remote add origin git@bitbucket.xxx/xxx.git
$ git push -u origin master

The authenticity of host 'bitbucket.org (xxx)' can't be established.
RSA key fingerprint is xxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'bitbucket.org,xxx' (RSA) to the list of known hosts.
git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 [問題]
 bitbucketに追加した秘密鍵がサーバーには登録されてなかったためサーバー経由で接続時に権限がないと怒られる

 [解決策]

$ ssh-add ~/.ssh/id_rsa
$ ssh -A root@xxxx

#3. ローカルリポジトリ(サーバーでない)にクローン

$ git clone git@bitbucket.org:xxx/xxx.git

#etc.
git commitの時、ubuntuサーバーだったためエディタがnanoに設定されていたのでviに設定

$ git config --global core.editor "vi"
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?