Quickly generate .gitignore files from GitHub's official gitignore templates
A simple CLI tool that downloads .gitignore templates from the official github/gitignore repository and saves them to your project directory. No need to manually copy-paste or remember which files to ignore for your project type!
- 🚀 Fast & Simple - One command to generate your .gitignore file
- 📦 Zero Configuration - Works out of the box with npx
- 🎯 Official Templates - Uses GitHub's curated gitignore templates
- 🔄 Automatic Formatting - Smart name formatting (e.g.,
node→Node.gitignore,word-press→WordPress.gitignore) - ✨ Multiple Package Managers - Works with npm and yarn
No installation required! Use npx to run it directly:
npx create-gitnore [template-name]Or with yarn:
yarn create gitnore [template-name]If you prefer to install it globally:
npm install -g create-gitnore
# Then use it directly
create-gitnore [template-name]npx create-gitnore [template-name]Where [template-name] is the name of any template from the github/gitignore repository.
Node.js Project:
npx create-gitnore node
# or
yarn create gitnore nodePython Project:
npx create-gitnore pythonReact Project:
npx create-gitnore nodeWordPress Project:
npx create-gitnore wordpress
# or (case-insensitive with auto-formatting)
npx create-gitnore word-pressGo Project:
npx create-gitnore goJava Project:
npx create-gitnore javaVisual Studio:
npx create-gitnore visualstudioThis tool uses templates from github/gitignore. Popular templates include:
- Languages: Node, Python, Java, Go, Ruby, Rust, C, C++, C#, Swift, Kotlin, etc.
- Frameworks: Rails, Django, Laravel, etc.
- IDEs: VisualStudio, VisualStudioCode, IntelliJ, Eclipse, Xcode, etc.
- CMS: WordPress, Joomla, Drupal, etc.
- Other: macOS, Windows, Linux, Archives, etc.
To see all available templates, visit github/gitignore.
- You provide a template name (e.g.,
node) - The tool formats the name to match GitHub's naming convention (e.g.,
Node.gitignore) - Downloads the corresponding template from
https://raw.githubusercontent.com/github/gitignore/master/[TemplateName].gitignore - Saves it as
.gitignorein your current directory
If you get a "Not Found" error:
- Check the template name at github/gitignore
- Template names are case-sensitive after formatting
- Try variations:
node,Node, ornodejs
This tool will overwrite your existing .gitignore file. Make sure to back it up if you have custom rules!
- Combine Multiple Templates: Generate one template, then manually add rules from other templates as needed
- Customize After Generation: The generated file is a starting point - feel free to add project-specific rules
- Version Control: Always review the generated
.gitignorebefore committing to ensure it fits your needs
Contributions are welcome! Please feel free to submit a Pull Request.
ISC
Made with ❤️ by mwafa