Edgaras Karka
Edgaras Karka

Reputation: 7852

Can`t first push to docker based gitlab server

My gitlab server running on docker on Centos7 machine. I tried push exist repo to gitlab:

git remote rename origin old-origin

git remote add origin http://myhost/user/project.git

git push -u origin --all

Username for 'myhost': user

Password for 'myhost':

fatal: Authentication failed for ' http://myhost/user/project.git'

I tried server and gitlab credentials.

docker started with command:

docker run -p 80:80 -p 2222:22 -p 443:443 -d f77dd1b93b45

Upvotes: 0

Views: 31

Answers (1)

Mostafa Hussein
Mostafa Hussein

Reputation: 11980

  • Try to login through the web UI to ensure that you are typing the correct password
  • Check if Two-Factor Authentication is enabled if yes then you need to generate a personal access token to use it instead of username and password.

    You can create as many personal access tokens as you like from your GitLab profile.

    • Log in to your GitLab account.
    • Go to your Profile settings.
    • Go to Access tokens.
    • Choose a name and optionally an expiry date for the token.
    • Choose the desired scopes.
    • Click on Create personal access token.
    • Save the personal access token somewhere safe. Once you leave or refresh the page, you won’t be able to access it again.

Upvotes: 1

Related Questions