Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitlab redirects push/fetch/clone to sign in

I am trying to push a branch into a gitlab remote repository and an example of the behaviour would be:

git clone http://(path to branch)
Cloning into 'origin'...
fatal: unable to update url base from redirection:
    asked for: http://(path to branch)/info/refs?service=git-upload-pack
redirect: http://(path to root)/users/sign_in

please note the changes on the urls and also I entered my credentials in .git/config, as presented below

[user]
    name = myname
    pwd = mypassword
    password = mypassword

It's probably relevant that when I signed up, the repository asked for a public key that I had to make exclusively for the project.

like image 394
Paulo Avatar asked Sep 27 '18 17:09

Paulo


1 Answers

Try cloning the repository with no path to branch first, then checkout to the branch you want.

git clone git@(domain and path to the repository)

See details here. I'd recommend just setting up SSH access only takes a few minutes and much easier once it's running.

Next, just cd into the project you made and run

git branch -a

to view all project branches. Finally

git checkout [branchname]

should switch you to the branch.

like image 126
music2177 Avatar answered Sep 17 '22 09:09

music2177