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

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.

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.

git pull with access token, git push with username / password

I've got a problem with git push. Here are many threads regarding this issue, but none of them fit to my problem.
The company I work for, has it's own gitlab. Policy is only https, no ssh is allowed. For cloning and pulling, an access token is required. Pushing only with username/password. Don't ask me about the underlaying reason. Unfortunately I don't know it.
Error message is:
$ git push
fatal: unable to access 'https://<username>:<AccessToken>#<domain>/<owner>/<reponame>.git/': The requested URL returned error: 403
At least I alread was able to clone a repo, but I'm failing to push the changed content respectively. Ubuntu 18.04 is running on my laptop.
What do I need to do to solve my issue?
You already know that every remote stores a URL: origin literally means https://<username>:<AccessToken>#<domain>/<owner>/<reponame>.git/.
What you didn't know is that every remote actually stores two URLs. One is used for git fetch, and the second one is used for push. The second URL defaults to being the same as the first URL, but if you set it, you can set it to anything else, such as the URL without the access token. To set the second URL, you can use git remote set-url --push:
git remote set-url --push origin <url>
If you're like me, you might want to know about git config --edit as well, which will open the configuration file (typically just .git/config) in the same editor you're having Git use for everything else, where you can just edit it directly. But git remote is the tool designed for fiddling with the settings attached to each remote-name.

I cannot pull with source tree in github

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)

Facing errors in connecting openstack github repository?

Am new to linux and openstack.
I was trying to install openstack in local Linux environment -Redhat. When I was running the below command I was getting below error
[root#xyz123 apps]# git clone https://git.openstack.org/openstack-dev/devstack
Cloning into 'devstack'....
fatal: unable to access 'https://git.openstack.org. /openstack-dev/devstack': Failed to connect to 2001:4556:5666:334:be7. Network is unreachable
Tried the above URL with 'http.... But same error.
I also tried below URLs by googling.
git clone git://git.openstack.org/openstack-dev/devstack
Unable to connect to git.openstack.org:
git.openstack.org[0 : 100.138.234.128] : errNo =No route to host
git.openstack.org[1:2001.4334.6667.157.be67]: errNo=Network is unreachable
git clone https://github.com/openstack-dev/devstack.git
Unable to access 'https://github.com/openstack-dev/devstack.git/' : SSL received a record that exceeded the maximum permissible length
Note: git installed .version 1.8
I have no problems cloning that repo using either the "https:" or "git:" URLs.
Your problem could be / have been:
A temporary problem with the Openstack git servers.
A problem with the networking on the system where you are trying to run clone.
Your access could be blocked blocked by your organization's firewall.
Something like this: https://en.wikipedia.org/wiki/Censorship_of_GitHub

git-svn rejected Basic challenge now that VPN is required

I have been using git-svn for a few months now as an interface to the SVN repository for my company.
However, about a week ago my company changed their policy such that SVN is only reachable if connected by way of Cisco VPN.
I have no trouble connecting to VPN on my Linux Mint VM (which is where I do my coding), but I am now no longer able to pass authentication when I, for example, run git svn dcommit to checkin code changes.
I have tried:
rm -rf ~/.subversion, to get rid of any saved SVN authentication credentials and force it to take new ones, but this seems to have no effect, nor does it ever prompt me for fresh credentials, surprisingly.
starting in a freshly created directory and running git svn clone to initiate a new link to the SVN repository, but with the same authentication failures.
Here is what I see when running git svn dcommit or git svn clone:
$ git svn dcommit
Committing to https://<redacted>:2443/svn/LS/branches/PRODUCTION-SUPPORT-1/ls-policygen ...
WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-wCQwzG/pkcs11: No such file or directory
Authorization failed: OPTIONS of 'https://<redacted>:2443/svn/LS/branches/PRODUCTION-SUPPORT-1/ls-policygen': authorization failed: Could not authenticate to server: ignored NTLM challenge, rejected Basic challenge (https://<redacted>:2443) at /usr/local/libexec/git-core/git-svn line 943
The gnome-keyring warning has always been present, and never stopped commits before VPN was required.
take a look at this snipped from your error code:
Authorization failed: OPTIONS of 'https://<redacted>:2443/svn/LS/branches/PRODUCTION-SUPPORT-1/ls-policygen': authorization failed: Could not authenticate to server: ignored NTLM challenge, rejected Basic challenge (https://<redacted>:2443) at /usr/local/libexec/git-core/git-svn line 943
specially at this part: Could not authenticate to server: ignored NTLM challenge
It looks like your company also changed autentication methods too.
Take a look at: Does git clone work through NTLM proxies?
I would take this steps:
connect to your repository within your browser
try to connect with another user account - probably you have some cache files in your home directory
configure git or even svn according to NTLM auth
Good Luck,
LEslie

Resources