GitLab requires git@localhost password to push to a repo

前端 未结 15 1969
梦毁少年i
梦毁少年i 2020-12-30 03:38

I\'m trying to get GitLab up and running on my server. I followed the installation instructions at the gitlab github page and everything went well.

The issue is, whe

15条回答
  •  难免孤独
    2020-12-30 03:49

    I had the a similar problem: Gitlab server is inside a docker container and every time when I tried to push changes, I had: git@localhost's password:

    the root cause was using "localhost" as a name. Right way is to check out the IP of the GitLab's container by: $ docker inspect

    find the row: "IPAddress": "172.17.0.2",

    test it by: ssh -T git@172.17.0.2 the answer should be like this. "Welcome to GitLab, @user_name!"

    now it's necessary to fix repository's URL: $ git remote set-url origin git@172.17.0.2:user_name/repo-name.git

    after that the push command should work properly.

提交回复
热议问题