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

Re: Feature idea: Git hook for pre-checkout

From
KKKonstantin Khomoutov <kostix@bswap.ru>
Date
Jan 30, 2025, 14:11 UTC
Message-ID
<20250130141154.gglc65fegstuzbjy@carbon>
In-Reply-To
<Z5rhXrkbhINwFDXT@tapette.crustytoothpaste.net>
On Thu, Jan 30, 2025 at 02:18:06AM +0000, brian m. carlson wrote:
[...]
> It's also possible to use one name locally and push to another, such as with
> `git push origin my-feature:refs/features/foo`.

I would add that I, for one, have a habit of working on a detached HEAD and then pushing the results with

  git push HEAD:refs/heads/whatever

and only creating a local branch when I think I'm going to abandon the current work for too long (otherwise I just inspect the output of `git reflog HEAD` to find the place where I left off and then check it out back).

I don't think it's a widely adopted approach to work with Git, so mentioning it more for the purpose of widening the OP's view of the subject matter.

[...]
Previous: brian m. carlsonNext: Junio C Hamano
Message 3 of 5 in “Feature idea: Git hook for pre-checkout”
  1. Mike WeltevredeJan 29, 2025
  2. brian m. carlsonJan 30, 2025
  3. Konstantin KhomoutovJan 30, 2025
  4. Junio C HamanoJan 30, 2025
  5. Mike WeltevredeFeb 1, 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.