GitLabもといGitLab.com使ってみた

2016年5月16日

こんばんは。
最底辺です。

どうやら、GitLabは、オープンソースのgitサーバーシステムのようで
ホスティングサービスの方は、GitLab.comというようです。
前回、思いっきり間違っていたようですが、訂正はしません。はい。最底辺の戒めとして残します。

さて、今回は、ちゃんとgit環境移行しますよ。
SineUpや設定は、適当にググりながらやってみました。

gitのurlを変更します。

git remote git@gitlab.com:xxx/dotfiles.git

で、以前、作った公開鍵をアップロードして後は、sshに設定すれば、OKです。
このあたりを参考にやってみました。

sshのconfigにサーバ名追加っと。

Host gitlab
    Hostname gitlab.com
    RSAAuthentication yes
    IdentityFile ~/.ssh/id_private

よし、トライしてみるか。

$ git clone gitlab:xxx/dotfiles.git
Cloning into 'dotfiles'...
Enter passphrase for key '/home/lowestman/.ssh/id_private':
Permission denied (publickey).
fatal: Could not read from remote repository.

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

あれ? なんか失敗しているなあ。 う〜ん。原因はなんだろう。
失敗した原因を見るには、sshにオプション-vTとかいうのをつけて実行するといいらしい。

lowestman@takion7 ~
$ ssh -vT gitlab
OpenSSH_7.2p1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /home/lowestman/.ssh/config
debug1: /home/lowestman/.ssh/config line 10: Applying options for gitlab
debug1: Connecting to gitlab.com [104.210.2.228] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
... (略) ...
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/lowestman/.ssh/id_private
Enter passphrase for key '/home/lowestman/.ssh/id_private':
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

う〜ん。鍵の認証が上手くいっていない?
念のため、もう一回鍵をアップロードしてみたが変わらず。。。

sshのconfig設定か?
ということで、Hostにgitlab.comを追加してみてみた。

Host gitlab gitlab.com
    Hostname gitlab.com
    RSAAuthentication yes
    IdentityFile ~/.ssh/id_private

お〜。上手くいったぽい。なんかよくわからないけど、host名がgitのset-urlと合っていないから?
まあ、出来たのでよしとします。(いや、だめだろう。。。)

では。