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

Re: Using a git repository on the root directory

From
MRMiguel Ramos <mail@miguel.ramos.name>
Date
Apr 17, 2010, 11:39 UTC
Message-ID
<y2y3e2876431004170439o15fbe62dv612157226d978fa5@mail.gmail.com>
In-Reply-To
<m3zl12eaif.fsf@localhost.localdomain>
2010/4/17 Jakub Narebski <jnareb@gmail.com>:
Show 29 quoted lines
> Miguel Ramos <mail@miguel.ramos.name> writes:
>
>> Is it possible with git to use a git repository on the root directory?
>> I'm trying to replace subversion doing this.
>> I have a populated repository elsewhere, I can clone this to an empty
>> directory and then move .git to / to work around the demand that the
>> target directory is empty and at the same time avoid overwriting
>> files.
>> I used this method before to get my home directory versioned with
>> success, so far.
>>
>> When I'm on the root directory, things seem to work minimally. I do
>> git status, etc, and get the expected results.
>> However, if I change say to /etc, or any other directory, for that
>> matter, then git status tells me that every file in the repository is
>> deleted.
>> Adding files doesn't work, nothing works at all.
>>
>> I know this is an unforeseen use of git, however, unforeseen might not
>> imply forbidden.
>> I'm pretty disappointed I couldn't get it working.
>
> The 'nd/root-git' branch (merged into 'master' as v1.7.1-rc0~89)
> might have addressed the issue you are seeing.
>
> --
> Jakub Narebski
> Poland
> ShadeHawk on #git

Yes, that's exactly it. I tried out v1.7.1-rc1 and it works.

Good thing this got merged into the main branch. I'm putting * in /.git/info/exclude, so adding files to the repository must be explicit. It seems to work, but if anyone knows of any downside to doing this, please tell me, I'm new to git.

Thanks
-- 
Miguel Ramos <mail@miguel.ramos.name>
PGP A006A14C
Previous: Jakub Narebski
Message 9 of 9 in “Using a git repository on the root directory”
  1. Miguel RamosApr 16, 2010
  2. Gabriel FilionApr 17, 2010
  3. david@lang.hmApr 17, 2010
  4. Miguel RamosApr 17, 2010
  5. david@lang.hmApr 17, 2010
  6. Miguel RamosApr 17, 2010
  7. david@lang.hmApr 17, 2010
  8. Jakub NarebskiApr 17, 2010
  9. Miguel RamosApr 17, 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.