Hello i want to clone and pull some git repo to my linux server , i have an issue when running : git clone and git pull in my server. it says : warning: url has no scheme IP:Port , fatal: credential url cannot be parsed IP:Port. i tried to set new url with this command : git remote set-url origin http://IP:PORT/my.Git.Server/API_WEBTOOL3.git. but it doesnt work the same error still appear. Please help my issues :(
3 Answers
Removing an empty line from ~/.git-credentials solved the problem for me.
I had the same problem using git on ubuntu and a git credential helper "store". The upgrade to git 1:2.17.1-1ubuntu0.7 (see here) brought the problem. This security update adds more strict checks of the credential URLs. It seems the empty line is misinterpreted as a bad URL.
4 Comments
git config -l and find the line credential.helper=store.... If there is a filename then use this one, else it's ~/.git-credentials. Then open this file and remove all empty or other "useless" lines. BTW: It seems there is a patch for git which hopefully will by released soon: lore.kernel.org/git/20200427004640.GA28818@Carlos-MBP/T/…nano ~/.git-credentials, delete the last line, Ctrl+O to save and Ctrl+X to exit.This should be solved with With Git 2.27 (Q2 2020).
Recent updates broke parsing of "credential.<url>.<key>" where <url> is not a full URL (e.g. [credential "https://"] helper = ...) stopped working: that has been fixed.
See commit 9a121b0, commit 6828e59, commit 21920cb (24 Apr 2020) by Johannes Schindelin (dscho).
(Merged by Junio C Hamano -- gitster -- in commit da05cac, 05 May 2020)
credential: handlecredential.<partial-URL>.<key>againSigned-off-by: Johannes Schindelin
Reviewed-by: Carlo Marcelo Arenas BelónIn the patches for CVE-2020-11008, the ability to specify credential settings in the config for partial URLs got lost. For example, it used to be possible to specify a credential helper for a specific protocol:
[credential "https://"] helper = my-https-helperLikewise, it used to be possible to configure settings for a specific host, e.g.:
[credential "dev.azure.com"] useHTTPPath = trueLet's reinstate this behavior.
While at it, increase the test coverage to document and verify the behavior with a couple other categories of partial URLs.
And:
credential: optionally allow partial URLs incredential_from_url_gently()Signed-off-by: Johannes Schindelin
Reviewed-by: Carlo Marcelo Arenas BelónPrior to the fixes for CVE-2020-11008, we were
_very_ lenient in what we required from a URL in order to parse it into astruct credential. That led to serious vulnerabilities.There was one call site, though, that really needed that leniency: when parsing config settings a la
credential.dev.azure.com.useHTTPPath.
Settings like this might be desired when users want to use, say, a given user name on a given host, regardless of the protocol to be used.
Finally:
With the recent tightening of the code that is used to parse various parts of a URL for use in the credential subsystem, a hand-edited credential-store file causes the credential helper to die, which is a bit too harsh to the users.
Demote the error behaviour to just ignore and keep using well-formed lines instead.
See commit c03859a (02 May 2020) by Carlo Marcelo Arenas Belón (carenas).
See commit 20b4964 (28 Apr 2020) by Junio C Hamano (gitster).
(Merged by Junio C Hamano -- gitster -- in commit 933fdf8, 08 May 2020)
credential-store: ignore bogus lines from store fileReported-by: Dirk
Helped-by: Eric Sunshine
Helped-by: Junio C Hamano
Based-on-patch-by: Jonathan Nieder
Signed-off-by: Carlo Marcelo Arenas BelónWith the added checks for invalid URLs in credentials, any locally modified store files which might have empty lines or even comments were reported failing to parse as valid credentials.
(reported in this very page by the OP)
Instead of doing a hard check for credentials, do a soft one and therefore avoid the reported fatal error.
While at it add tests for all known corruptions that are currently ignored to keep track of them and avoid the risk of regressions.
1 Comment
"dev.azure.com" to the section [credential "dev.azure.com"] in the file .gitconfig helped me to fix it
git config -las a code block?