I cannot pull with source tree in github - gitlab

I am trying to pull in gitlab with source tree but unable to do so.
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
remote: HTTP Basic: Access denied fatal: Authentication failed for
'http://davy_yg#git.amanahcorp.com/daffi_gusti/soulfy_repo3.git/'
remote: Forbidden fatal: unable to access
'http://davy_yg#git.amanahcorp.com/daffi_gusti/soulfy_repo3.git/': The
requested URL returned error: 403 Completed with errors, see above.
How to fix the error so that I can pull and push?

See issue 6576 as a way to troubleshoot this issue.
For instance, you can:
try and see if cloning through ssh work
look for the production.log for a more precise error
check the project visibility to compare against the user permissions (a public project for instance should require no authentication)

Related

Gitlab clone project: authentication failed

I tried to simply clone a Gitlab project jusing both HTTPS and SSH and they both don't work and print back an atuhentication failed message.
When trying with https address:
git clone https://gitlab.com/project.aa/project.git
Cloning into 'frontend'...
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab.com/project.aa/project.git'
And with my SSH key that's the message I get:
Cloning into 'frontend'...
git#gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
What can I do?
Try log-out and login with the same credentials that you're trying to use for cloning the repository. If the problem persists: In Windows, Search for Credential Manager. In that choose Windows manager. Select your Gitlab credentials and modify it.

Folder's content are empty after pushing into bitbucket

I wanted to push folders from my local repositories into bit bucket. Somehow I was unable to do that.
I got the solution somewhere to use
$ git push -f origin master
which resolved the issue but erased all lines of code.
This is my very first use of bit bucket. How to get all content back?
Now, I deleted previous repository and created the new one. Typed below but getting error
$ git remote add origin
https://PoojaThapa#bitbucket.org/PoojaThapa/git-poojatest.git
fatal: remote origin already exists.
$ git push origin
fatal: HttpRequestException encountered.
An error occurred while sending the request.
remote: Not Found
fatal: repository 'https://PoojaThapa#bitbucket.org/PoojaThapa/git-
test.git/' not found
please suggest.
Assuming you have a repository in your current directory you can add a remote with any name using:
git remote add <remote-name> <url>
You are getting an error with your first command because a remote already exists called origin.
Try git remote -v to see which remotes you have already got defined.
In your case I think you want to create a new remote (with a different name, for example bitbucket), so
git remote add bitbucket https://PoojaThapa#bitbucket.org/PoojaThapa/git-poojatest.git
Verify that the remote was created correctly using git remote -v, then you can push to the new remote using <remote-name>/<branch>:
git push bitbucket/master
"repository not found" implies that the origin URL is incorrect. List your current remotes with git remote -v, and double-check that you have the correct URL(s) listed. (You should be able to go to the URL in your browser.)
If something is incorrect, you can fix it with git remote set-url origin correct-url-goes-here.

Authentication failed for git repository in Jeniks (linux)

I'm doing Jenkins config for first time. All the configuration about git, ssh, etc. is made in a linux server by console (VM). I've created a user and password for git and added the public key to the bitbucket host, I have connected by command line in linux to bitbucket and everything was fine. But when I try to connect to the remote repo in Jenkins Job Config, I get this error:
Failed to connect to repository : Command "/usr/bin/git -c core.askpass=true ls-remote -h 'repo' HEAD" returned status code 128:
stdout:
stderr: fatal: Authentication failed for 'repo'
Any idea?
Thanks in advance.
Finally I got a solution just writing the repo url as : https://:#bitbucket.org//.git
Maybe it would exist another for avoiding to express the password in the url.
Thank you #ComputerDruid and rest of comunity ;)

gitlab cannot pull or clone project

I got this message error when do this command git clone https://project.gitlab.cct/user/testproject.git Initialized empty Git repository in /root/testproject/.git/ error: The requested URL returned error: 401 Unauthorized while accessing https://project.gitlab.cct/user/testproject.git/info/refs
fatal: HTTP request failed
This project is set private and although I were granted permission to access this project (joined), someone help me to turn off authorization for private project or appear a password prompt to access
Thank you!

http 401.1 error while performing a GIT clone from a Linux server

I'm running TFS 2013 with a GIT team project. When I perform a git clonefrom one of the local Windows servers I don't have any issues:
-bash-4.1$ git clone "http://tfsadm:tfspas#tfs.server.com:8080/tfs/DefaultCollection/_git/Main"
Initialized empty Git repository in /home/tfsadm/Mainframe/.git/
but when I perform a git clone from Linux, I get the following error:
error: The requested URL returned error: 401 while accessing http://tfsadm:tfspas#tfs.server.com:8080/tfs/DefaultCollection/_git/Mainframe/info/refs fatal: HTTP request failed
Error: The requested URL returned error: 401 while accessing https://github.com/Joey-myproject/repo.git/info/refs fatal: HTTP request failed
is an often reoccuring error.
One of the reasons of this happening is because the client is not authorized to access to that resource.
A general solution is to check for the following:
Do you have a stable git version?
Is the remote correct configured?
If 2FA is enabled, if so provide an access token.
Double check your permissions(username/password in configs) perhaps also try to use the format ' https://username#mydomain.org/project.git''
Try ssh instead of https
I am not sure, but have you already seen this link Can't clone a github repo on Linux via HTTPS?
It can give some extra information.

Resources