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

Re: [git-users] Problem using detached worktrees with commands implemented in scripts

From
Dale R. Worley <worley@alum.mit.edu>
Date
Oct 18, 2013, 22:50 UTC
Message-ID
<201310182250.r9IMoW57003157@freeze.ariadne.com>
In-Reply-To
<xmqq4n8fzmmj.fsf@gitster.dls.corp.google.com>
> From: Junio C Hamano <gitster@pobox.com>
Show 7 quoted lines
> Now, when you say "the cwd contains the .git directory", do you mean
> 
> 	cd /repositories
>         git add ../working/trees/proj-wt1/file
> 
> updates "file" in the /repositories/proj.git/index?  Or do you mean
> this?
The pattern I use is to have this:
	/repository/.git
	/working/...
then
	cd /repository
	git add /working/x/y/z

works as you'd expect it to. "git rm" seems to work correctly under these circumstances as well.

I seem to recall that using relative <path> values doesn't work under some conditions involving symbolic links, but I can't recall the details right now.

> you talk about starting Git command _outside_ the working tree
> (whether the working tree has its repository embedded in it is not
> very relevant).

The above pattern is what I mean, where the cwd is not within the work tree.

Dale
Previous: Dale R. Worley
Message 17 of 17 in “[git-users] Problem using detached worktrees with commands implemented in scripts”
  1. Dale R. WorleyOct 16, 2013
  2. Junio C HamanoOct 16, 2013
  3. Philip OakleyOct 16, 2013
  4. Junio C HamanoOct 16, 2013
  5. Philip OakleyOct 17, 2013
  6. Junio C HamanoOct 17, 2013
  7. Philip OakleyOct 17, 2013
  8. Philip OakleyOct 17, 2013
  9. Jonathan NiederOct 17, 2013
  10. Philip OakleyOct 18, 2013
  11. Dale R. WorleyOct 18, 2013
  12. Dale R. WorleyOct 17, 2013
  13. Junio C HamanoOct 17, 2013
  14. Dale R. WorleyOct 18, 2013
  15. Junio C HamanoOct 18, 2013
  16. Dale R. WorleyOct 21, 2013
  17. Dale R. WorleyOct 18, 2013

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.