Empty Levure folders not tracked on GitHub

Collaborate on tools, libraries, and applications beyond the IDE

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Locked
Martin Koob
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sun May 27, 2007 8:19 pm

Empty Levure folders not tracked on GitHub

Post by Martin Koob » Sun Feb 21, 2021 3:01 pm

Hi.

I have set up a GitHub repository to track a Levure based project. On the desktop the project has the full Levure folder structure in the local repository. However in the GitHub remote repository it does not contain any folders that are empty.

This works fine if I am updating the project from my desktop computer and pushing the commits to the repository but if someone else clones the repository locally they will not get the full Levure folder structure in their local repository.

According to GitFAQ: Can I add empty directorieshttps://git.wiki.kernel.org/index.php/G ... ctories.3F it says:
If you really need a directory to exist in checkouts you should create a file in it. .gitignore works well for this purpose
Stack Overflow https://stackoverflow.com/questions/115 ... 77#8944077 contains several suggestions of how to trick Git into tracking 'empty' directories.

Is one of those suggestions the way to go or do people just have to manually create the directory structure locally so it is ready for when they need to add a file to an empty directory at which point Git will start tracking the file and thereby the directory?

Martin

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Empty Levure folders not tracked on GitHub

Post by trevordevore » Mon Feb 22, 2021 3:44 pm

Martin - I don't track empty folders so I don't have a strategy for doing so. Can you elaborate on why you need empty folders in your project?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Empty Levure folders not tracked on GitHub

Post by trevordevore » Sat Feb 27, 2021 3:24 am

Martin - I was browsing through a repo today and came across .gitkeep files. Turns out that is a convention some people use (or just .keep) to make sure a folder is part of a repo. Just add .gitkeep or a .keep file (to the folder and add that to the repo. Just another option for you.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Martin Koob
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sun May 27, 2007 8:19 pm

Re: Empty Levure folders not tracked on GitHub

Post by Martin Koob » Sat Feb 27, 2021 3:01 pm

Hi Trevor

The reason I was asking about tracking the empty directories was that I wanted a way to ensure the users who are not familiar with Levure and who were cloning the project would get the complete Levure directory structure for a template application. That way if they were to add files the appropriate directories would already be there for them to place the files into. Otherwise they would have to figure out the names and locations of the directories to create and then create them before creating their files. I just wanted to make it as easy as possible for them (and me).

Thanks for the tip about the convention of creating files named .gitkeep or .keep as a way to ensure directories are tracked. That will do the trick.

Martin

Locked

Return to “Community Projects”