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

Re: [RFE] Please add name and email to git credentials

From
NMNicolas Mailhot <nicolas.mailhot@laposte.net>
Date
Nov 1, 2018, 14:42 UTC
Message-ID
<62bf61555a6c2789e959e4f085bfedf28b60f268.camel@laposte.net>
In-Reply-To
<CAP8UFD1rTJNOZzFMryY9BNKHUZKE8FUEgw+4jFfnZ7G8KGNrkw@mail.gmail.com>
Le jeudi 01 novembre 2018 à 15:13 +0100, Christian Couder a écrit :
> 
> How can Git know when you commit where you will want to push the
> commit afterwards?

You have an url in the repo config. of course you can change it between the commit and the push, but that's not the general case.

Nowadays, most git projects have a preferred git hosting, and your name/email with the project match the credentials you use to push (otherwise things like gitlab/github issues trackers would not work at all).

> What if you want to push the same commit to 2 different places that
> need different credentials?

Then you do not use git credentials and have to configure all by hand. Which will usually be a major error-prone PITA, so you’ll end up pushing to the system that matches the ID you want to se in git logs, and then push from this system to others.

-- 
Nicolas Mailhot
Previous: Christian CouderNext: Christian Couder
Message 6 of 13 in “[RFE] Please add name and email to git credentials”
  1. Nicolas MailhotNov 1, 2018
  2. Ævar Arnfjörð BjarmasonNov 1, 2018
  3. Nicolas MailhotNov 1, 2018
  4. Ævar Arnfjörð BjarmasonNov 1, 2018
  5. Christian CouderNov 1, 2018
  6. Nicolas MailhotNov 1, 2018
  7. Christian CouderNov 2, 2018
  8. Nicolas MailhotNov 2, 2018
  9. Jeff KingNov 2, 2018
  10. Nicolas MailhotNov 2, 2018
  11. Jeff KingNov 2, 2018
  12. Randall S. BeckerNov 1, 2018
  13. Nicolas MailhotNov 1, 2018

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.