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

Re: Handling empty directories in Git

From
Andrew Keller <andrew@kellerfarm.com>
Date
Apr 8, 2014, 17:02 UTC
Message-ID
<3FBDE5D3-1DC6-420C-866B-036D0CB17BA2@kellerfarm.com>
In-Reply-To
<1396968442.95061.YahooMailNeo@web120806.mail.ne1.yahoo.com>
On Apr 8, 2014, at 10:47 AM, Olivier LE ROY <olivier_le_roy@yahoo.com> wrote:
Show 9 quoted lines
> Hello, 
> 
> I have a project under SVN with contains empty directories.
> 
> I would like to move this project on a Git server, still handling empty directories.
> 
> The solution: put a .gitignore file in each empty directory to have them recognized by the Git database cannot work, because some scripts in my projects test the actual emptiness of the directories.
> 
> Is there any expert able to tell me: this cannot be done in Git, or this can be done by the following trick, or why there is no valuable reason to maintain empty directories under version control?
Git is designed to track files.  The existence of folders is secondary to the notion that files have a relative path inside the repository, which is perceived by the user as folders.
Why can't your scripts create the folders on demand?  Or, could your scripts interpret a missing folder as an empty folder?

Thanks, Andrew Keller

Previous: Olivier LE ROYNext: Andrew Keller
Message 2 of 9 in “Handling empty directories in Git”
  1. Olivier LE ROYApr 8, 2014
  2. Andrew KellerApr 8, 2014
  3. Andrew KellerApr 8, 2014
  4. Olivier LE ROYApr 8, 2014
  5. Matthieu MoyApr 8, 2014
  6. David KastrupApr 8, 2014
  7. Olivier LE ROYApr 8, 2014
  8. Olivier LE ROYApr 8, 2014
  9. Øyvind A. HolmApr 11, 2014

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.