Include .gitignore when cloning starter

Enonic version: 6.4.1
OS: OSX

When I use the toolbox.sh init-project command to download a starter (and start a new project), the .gitignore file doesn’t follow along.

This is kind of a pain, since I then have to set up my own .gitignore file before starting out - when the one included in the starter kit github repo is more than good enough.

Since you’re awesome and open source your code, I noticed this line in the toolbox app that explicitly removes this file. Why is that?

I’ll be more than happy to submit a pull request for this, just want to know if there’s a particular reason why you’re doing it this way.

Hi Kristofer!

This is most likely just an overdesign in cleaning away git related stuff. We’ll get this fixed :slight_smile:

1 Like

As promised - pull request: https://github.com/enonic/xp/pull/2940

To explain the reason:
The idea was to use Git only to host the starter-kits. These kits are free from all version control systems.
But you will want to work and test your starter-kit and, to avoid to push unwanted files, you will need a .gitignore.
But this file is not a part of the starter kit and does not need to be downloaded by users.

But in your case, I can understand that if you want to create a starter kit WITH a .gitignore file, it will be a problem.

I checked the pull request and I see that you also keep the .gitkeep files.
These are present to allow empty folders to be cloned.
The user will now have folders with an unnecessary .gitkeep in them.

If the user wants to use SVN for example he will have to delete all these .gitkeep and .gitignore files. (But again I can understand that if you plan to use Git, then it is nice to have already a .gitignore file).
What do you think tsi?

Other proposition: We could add a flag to keep them

Thanks for explaining @gri :smiley:

I’m pretty sure you shouldn’t optimize for people using SVN - it’s a very small portion of your users, if any.

Pull request merged.

But to answer to the last comment, it is not an optimisation for people using SVN.
The starter kits do not contain a .gitignore file. But there is a .gitignore file about the starter-kits because these are hosted on github.

1 Like