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

Re: Self-inflicted "abort" in a newbie attempt at read-only exploration of a cloned repository?

From
TMThierry Moreau <thierry.moreau@connotech.com>
Date
Apr 6, 2018, 00:50 UTC
Message-ID
<5AC6C460.7060005@connotech.com>
In-Reply-To
<CAGyf7-GZgTpYXt4s+NURABYLBr8HQAZWxsrpLLVKnsOf2SYcBQ@mail.gmail.com>
On 05/04/18 11:34 PM, Bryan Turner wrote:
Show 23 quoted lines
> On Thu, Apr 5, 2018 at 4:18 PM, Bryan Turner <bturner@atlassian.com> wrote:
>>
>> So passing --work-tree tells Git where to store your _files_, but it's
>> still using the same .git directory.
>>
>> If your goal is to have worktrees for various versions, that implies
>> the git worktree [1] command might be more along the lines of what
>> you're looking for. An invocation based on above might look like this:
>> $ git -C linux-stable/ worktree add $PWD/tmp/ checkout linux-4.15.y
>
> Apologies, I didn't mean to have the "checkout" in that.
> $ git -C linux-stable/ worktree add $PWD/tmp/ linux-4.15.y
>
>>
>> That should leave linux-4.16.y checked out in linux-stable, while
>> creating a full work tree in $PWD/tmp that has 4.15.y checked out.
>>
>> Note that worktree is a newer git command. 2.17 has it, but old
>> versions like 2.1 won't.
>>
>> [1] https://git-scm.com/docs/git-worktree
>>
>> Hope this helps!
For sure, it helps! Thanks.
- Thierry
Previous: Bryan TurnerNext: Jeff King
Message 4 of 6 in “Self-inflicted "abort" in a newbie attempt at read-only exploration of a cloned repository?”
  1. Thierry MoreauApr 5, 2018
  2. Bryan TurnerApr 5, 2018
  3. Bryan TurnerApr 5, 2018
  4. Thierry MoreauApr 6, 2018
  5. Jeff KingApr 6, 2018
  6. Thierry MoreauApr 6, 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.