https で clone したのを ssh にする

 既に https で clone してて ssh に出来ないよって言う人も origin を ssh に変更すれば普通に ssh になるはず。

今の origin を確認する

$ git remote -v

https になっている場合

origin  https://gitlab.com/accountname/hoge.git (fetch)
origin  https://gitlab.com/accountname/hoge.git (push)

見たいに https が出るはず。hogeの所は変動する。

origin を変更する

$ git remote set-url origin git@gitlab.com:accountname/hoge.git

git@gitlab.com:accountname/hoge.git の所は自分の gitlab のページの HTTPS/SSH の URL を入れる。HTTPSSSH はプルダウンメニューから選べるので SSH の URL を選ぶ。

上手く言ったかを確認する

$ git remote -v
origin  git@gitlab.com:accountname/hoge.git (fetch)
origin  git@gitlab.com:accountname/hoge.git (push)

のように https の所が git@gitlab.com: になっていれば変更できている。