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

Re: git remote set-head automatically

From
Bence Ferdinandy <bence@ferdinandy.com>
Date
Jan 12, 2025, 08:19 UTC
Message-ID
<D6ZY4MU53E2I.3LWESUZX6TR5A@ferdinandy.com>
In-Reply-To
<CAAHKNRF8JDUTH-QzPG1b4-wafzU+MXaMNinfBRu3JfCssfwGUw@mail.gmail.com>
On Tue Nov 19, 2024 at 16:40, Caleb Cushing <xenoterracide@gmail.com> wrote:
Show 18 quoted lines
> sounds great. I think I realized why I didn't have it. It's not done
> by `git remote add <origin> https://...`  my experiment was `git
> remote rm origin` and then `git remote add origin ... ; git fetch
> --all --prune` I think I also tried without the prune option. git
> version 2.46.1
>
> What I want mostly is for that HEAD ref to always exist. As far as
> there being ways to configure it, that's all good but I don't want to
> explain doing that to consumers of my code. I'd rather it just work
> for them, on clones, and add remotes or fetch if it's missing.
>
> I'm not super worried about it being updated as I feel like if that
> ever happens it's something loudly communicated, and I'm more willing
> to find it ok to make that an FAQ, if this breaks because that changed
> you can manually update that. Mostly I'm of the opinion that what I'm
> doing needs to work in various CI environments out of the box.
>
> Thanks for the info, hopefully soon (tm).

It's in the new release now, it also got some configuration options, but the default should be what you want

https://git-scm.com/docs/git-config#Documentation/git-config.txt-remoteltnamegtfollowRemoteHEAD

Best, Bence

Previous: Bence Ferdinandy
Message 10 of 10 in “git remote set-head automatically”
  1. Caleb CushingNov 15, 2024
  2. Jeff KingNov 16, 2024
  3. Bence FerdinandyNov 16, 2024
  4. Caleb CushingNov 19, 2024
  5. Caleb CushingNov 19, 2024
  6. Jeff KingNov 19, 2024
  7. Junio C HamanoNov 20, 2024
  8. Junio C HamanoNov 20, 2024
  9. Bence FerdinandyNov 20, 2024
  10. Bence FerdinandyJan 12, 2025

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.