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

RE: git checkout -b refs/master origin/master

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jul 9, 2021, 14:56 UTC
Message-ID
<60e8639b87a83_226420859@natae.notmuch>
In-Reply-To
<71d3662c-411b-88aa-5cfc-b2f86a067507@mfriebe.de>
Martin wrote:
> Especially the effect on
> git for-each-ref --format="ref=%(refname:lstrip=-1)"
> master
It's probably better to do refname:lstrip=2.
> You only get part of the branch name.
> Because "lstrip" does not distinguish between the / as separator in the 
> refs, and the "/" as part of the name.

That shouldn't matter. I use 'fc/area/topic' as names of my branches, and I know Junio uses similar names: '<contributor>/topic'.

-- 
Felipe Contreras
Previous: Martin
Message 2 of 2 in “git checkout -b refs/master origin/master”
  1. MartinJul 9, 2021
  2. Felipe ContrerasJul 9, 2021

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.