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

Re: rebase not honoring core.worktree pointing elsewhere

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Nov 3, 2010, 00:13 UTC
Message-ID
<AANLkTi=T5kHfgNOpOtCDCoq7epEgwUrVayaUCbf35dSU@mail.gmail.com>
In-Reply-To
<loom.20101102T165800-486@post.gmane.org>
On Tue, Nov 2, 2010 at 11:26 PM, Paul Drews <paul.drews@intel.com> wrote:
Show 23 quoted lines
> BTW, the impetus for this is a big integrated cross-compilation build system
> that has a nasty habit of deleting and re-creating a chroot environment
> containing the directory structures including the work tree.  If the ".git"
> dir is at the "normal" place "inside" the work tree, it gets deleted along
> with all the work I have done.  Not good, which is why I want to keep the
> ".git" somewhere else that's safe.  Solutions to this:
>
> (preferred) core.worktree pointing into worktree elsewhere, run all git
> commands from GIT_DIR.  Would be great if rebase worked under these
> circumstances.
>
> (best fallback) no core.worktree, export GIT_DIR pointing elsewhere, run all
> git commands from unmarked root of worktree.
>
> (complex) A complex scenario pushing and pulling stuff between a git repo
> inside the worktree and another git clone outside the worktree.
>
> (implementation dependent) Having the ".git" dir inside the worktree be a
> symbolic link to a dir somewhere outside the work tree.  Keeps the actual ".git"
> contents safe from deletion.  Works so far, but this is Tampering With The
> Implementation in a way that is likely to fail down the road somewhere,
> e.g., if an internal script does cd to the GIT_DIR, then cd relative to
> that to try to get back into somewhere else in the work tree.
Another one: create a .git file with this line and put it in worktree's topdir
gitdir: /path/to/real/git.dir
See gitrepository-layout.txt.
-- 
Duy
Previous: Paul DrewsNext: Paul Drews
Message 6 of 10 in “rebase not honoring core.worktree pointing elsewhere”
  1. Paul DrewsNov 1, 2010
  2. Sverre RabbelierNov 1, 2010
  3. Nguyen Thai Ngoc DuyNov 2, 2010
  4. Junio C HamanoNov 2, 2010
  5. Paul DrewsNov 2, 2010
  6. Nguyen Thai Ngoc DuyNov 3, 2010
  7. Paul DrewsNov 3, 2010
  8. Nguyen Thai Ngoc DuyNov 3, 2010
  9. Jonathan NiederNov 3, 2010
  10. Nguyen Thai Ngoc DuyNov 4, 2010

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.