gitlab redirects push/fetch/clone to sign in

13,547

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.

Share:
13,547
Paulo
Author by

Paulo

Updated on June 04, 2022

Comments

  • Paulo
    Paulo almost 2 years

    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.