Git Push Error - 401 Unauthorized While Accessing...

If you have an existing folder that you want to push, the instructions on GitLab are as follows


cd existing_folder 

git init git remote add origin https://gitlab.com/username/MyProject.git 

git add . 

git commit -m "Initial commit" 

git push -u origin master


However I was receiving the following error;


error: The requested URL returned error: 401 Unauthorized while accessing https://gitlab.com../...


Changing the code to the following worked;


cd existing_folder

git init git remote add origin https://gitusername@gitlab.com/username/MyProject.git

git add .

git commit -m "Initial commit"

git push -u origin master


You will then be prompted for your GitLab password.


Hope this helps!

Git - Access denied fatal: Authentication failed ...
Git Rename Branch Local and Remote Securely
 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Guest
November 24, 2020

Captcha Image

By accepting you will be accessing a service provided by a third-party external to https://www.johnnyshongo.com/