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

Multiple checkouts of the same repository

From
MMMatt McCutchen <hashproduct+git@gmail.com>
Date
Oct 1, 2006, 19:03 UTC
Message-ID
<3bbc18d20610011203p40d631b7o3bd2c6971a2bfcca@mail.gmail.com>
Dear git people,

Maybe this is common knowledge, but I thought I should mention it in case it isn't. I had a git repository in a directory A and I wanted to check out a branch of the repository to a different directory B. So I created B/.git and filled it with symlinks pointing to the files in A/.git, except for index and HEAD because those need to be different for each checkout; then I ran git-checkout <branch> to fill B. Now I can view and edit each checkout independently, but they are backed by the same set of objects and refs. However, I must remember to commit to each branch only through the checkout whose HEAD is linked to it, otherwise that checkout won't get updated.

Matt
Next: Johannes Schindelin
Message 1 of 8 in “Multiple checkouts of the same repository”
  1. Matt McCutchenOct 1, 2006
  2. Johannes SchindelinOct 1, 2006
  3. Matt McCutchenOct 1, 2006
  4. Johannes SchindelinOct 1, 2006
  5. Matt McCutchenOct 1, 2006
  6. Johannes SchindelinOct 2, 2006
  7. Daniel BarkalowOct 3, 2006
  8. Junio C HamanoOct 3, 2006

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.