0

I am using git to push my code to Gitlab. Following are the commands I am using

git clone https://<mygitlab.com>/gke-app-namespace-deploy.git
cd gke-app-namespace-deploy
git checkout -b  master
git branch
   main
   * master
git commit -m "first commit"
git remote set-url origin https://<mygitlab.com>/askar/gke-app-ns-deploy.git
$ git push -u origin master

Username for 'https://<mygitlab.com>': askar
Password for 'https://askar':
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://<mygitlab.com>/askar/gke-app-ns-deploy.git/' 

The same credentials works while downloading the code but I am getting Access Denied message while uploading the code.

What I am trying to do is clone code from gke-app-namespace-deploy.git' and push to a new repository 'gke-app-ns-deploy.git. Not sure if git by design will allow this.

torek
  • 448,244
  • 59
  • 642
  • 775
Zama Ques
  • 1,497
  • 5
  • 26
  • 45

1 Answers1

0

Try,

git remote add origin https://<access-token-name>:<access-token>@gitlab.com/myuser/myrepo.git

From: https://stackoverflow.com/a/52074198/2675670

Richard
  • 2,226
  • 2
  • 19
  • 35