git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git https transport and wrong password

From
Jeff King <peff@peff.net>
Date
Apr 2, 2013, 20:05 UTC
Message-ID
<20130402200551.GA535@sigill.intra.peff.net>
In-Reply-To
<20130402194751.GV30514@lakka.kapsi.fi>
On Tue, Apr 02, 2013 at 10:47:51PM +0300, Mikko Rapeli wrote:
> Don't know anything about curl but maybe git could parse the url for a
> username and prompt for the password before the first 401 failure roundtrip
> that's now in place. I guess most of this logic is in http.c.

We used to do that but stopped, as curl might also be able to retrieve the password from .netrc; the extra prompt was an annoyance to users in this situation.

Now that we have the credential subsystem, I would recommend dropping usernames from all git-over-http URLs, and either:

  1. Using a credential helper that supports secure long-term storage
     (osxkeychain, wincred, etc).
  2. Specifying the username to the credential subsystem explicitly, by
     putting something like:
       [credential "https://yourhost/"]
              username = yourusername
     in your git config.

Obviously (1) is nicer, but you may have corporate policies against storing credentials. Or you may have a complicated single sign-on procedure, where the password changes. In that case, I would still say it is worth writing a custom helper script that can feed the temporary credential to git.

-Peff
Previous: Mikko RapeliNext: Mikko Rapeli
Message 5 of 9 in “git https transport and wrong password”
  1. Mikko RapeliApr 2, 2013
  2. Mikko RapeliApr 2, 2013
  3. Jeff KingApr 2, 2013
  4. Mikko RapeliApr 2, 2013
  5. Jeff KingApr 2, 2013
  6. Mikko RapeliApr 2, 2013
  7. Mikko RapeliApr 3, 2013
  8. Jeff KingApr 3, 2013
  9. Mikko RapeliApr 3, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.