Can you ignore files/folders when making a Repo from a template?

I set up a GitHub Repository as a template so that other people can use it to create documentation or similar.

That said would I like to make it, so that when people click the “Use this template” button, that the copied Repo won’t contain certain files or folders like the

Is there a way to set a file or similar to define files/folders that should not be copied from the template repository?

(If not, then I hope it could be considered as a feature in the future.)


Hi @andre601,

Thank you for being here. At the moment there isn’t a way to ignore files when creating from repository templates. Ideally there will be an implemented  dot ignore file for repository templates, and I’ve passed that suggestion to the team for consideration. Although I can’t guarantee when or if this feature would be implemented please know your feedback is in the right hands.


So excluding files or folder being added to the zip also isn’t possible then?

I got this repo which has template files, these are added in the zip when the repo is downloaded. I would like to exclude those.

I hope this feature will be included soon…


+1 for this! Specifically, when making a repository from a template, I don’t want to include package manager lockfiles.

1 Like

It’d probably make sense to put it in /.github because templates are a github-specific concept. Maybe something like /.github/.template-ignore.

Just to add to how useful this would be… I’m making a website template, and it’d be great to only give users the files they really need. There’s a test bed page for my own development purposes that they don’t need. And there’s a bunch of documentation that should stay in the same repo (because it’s for the template), but doesn’t need to be duplicated to every clone of the template.

I think having it as a dot-file in the root, similar to .gitignore would make a bit more sense, in case that any other git repo-site (bitbucket, gitlab, gittea, etc) would want to adobt this idea in the future. I for myself see a new potential feature alongside the .gitignore file that could help improve any future git repositories…

But that’s just my thinking.

There is a way of solving this (somewhat manually) by using workflows that trigger on: create or on the first push. When the user creates a repo from the template, the workflow can edit and delete files at will and then push a commit. A good example is this repository:
with the workflow:

This approach is pretty nice, but has 2 major cons:

  1. It’s not interactive. It would be nice if the user could set fields like “organization name” instead of forcing projects to guess from the Github org.
  2. It has a delay. It takes a minute or two for the workflow to push the commit, so instructions on templates that use this approach are basically like “please wait a moment and refresh the page until it’s done!”

@andreagriffiths11 I’m a bit late here but if there is some internal ticket on this feature, it would be wonderful if it went beyond a mere “ignore” file and instead had some interactivity and integration with Github Actions and workflows.