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

Re: The shared Git repo used by git-new-workdir

From
HHHolger Hellmuth <hellmuth@ira.uka.de>
Date
Jan 16, 2012, 19:15 UTC
Message-ID
<4F14774A.40100@ira.uka.de>
In-Reply-To
<CAE1pOi3JocCoDGAmpCYdGdJN4E1nz8O4_i0MtLhwhP_axmH-uw@mail.gmail.com>
On 16.01.2012 19:57, Hilco Wijbenga wrote:
Show 16 quoted lines
> In my working directory:
> hilco@centaur /mnt/lacie/workspaces/my-project-master
> my-project-master (master $ u=)$ git status
> # On branch master
> nothing to commit (working directory clean)
>
> In the shared repo:
> hilco@centaur ~/git-clones/my-project my-project (master +$ u=)$ git status
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD<file>..." to unstage)
> #
> #       deleted:    .gitattributes
> #       modified:   .gitignore
> #       new file:   ...
> ... hundreds more ...

This is related to your using two repos with the same branch (irrespective of root repo or not).

There is nothing wrong with that per se, but if you add/commit/merge etc in one of those two, the working directory and index of the other repo doesn't get updated automatically. You would have to do "git reset --hard" in that repo to get it up-to-date

If you want to avoid this just don't check out the same branch in any two repos, root or not.

Previous: Hilco Wijbenga
Message 4 of 4 in “The shared Git repo used by git-new-workdir”
  1. Hilco WijbengaJan 14, 2012
  2. Holger HellmuthJan 16, 2012
  3. Hilco WijbengaJan 16, 2012
  4. Holger HellmuthJan 16, 2012

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.