I recently created a project on gitlab logged with my Github account.
But when cloning the project with gitbash (with my current ssh-key added to the gitlab account) the shell prompts for username/password, entering my username and password from github results in failure on authentication. (also email/password fails)
What I'm doing wrong?
Updated as of 4/28/2020 4:00 PM (Philippine Standard Time) to include scopes for private repos.
You need to create an access token from your GitLab account if you not yet set up a password or if protected by 2FA.
api
only as scope for your new access token. If you're working in private projects, also include read_repository
and write_repository
scopes.
Treat your access tokens like your passwords! Keep your scopes for next access tokens low and only share it with person/people you trust. Because I shared the example token here, any attempts to use it were now triggering errors because I revoked it before I update my answers.
Then, try logging in when using git push
.
## Init the local repo
mkdir test-to-connect
cd test-to-connect
git init
## Add your user name and email to Git.
git config --global user.name "Your name"
git config --global user.email "[email protected]"
## Create a new private repo after pushing.
git remote set origin https://your-gl-instance-host.dev/your-username/your-new-project-slug
## Commit
git commit -m "Initial commit"
## Push to GitLab
git push origin
## Username for 'https://your-gl-instance-host.dev': your-username
## Password for 'https://[email protected]' [REDACTED]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With