create-gitnore
v1.0.2
Published
Create .gitignore default file from github/gitignore
Readme
create-gitnore
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!
Features
- 🚀 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
Installation
No installation required! Use npx to run it directly:
npx create-gitnore [template-name]Or with yarn:
yarn create gitnore [template-name]Global Installation (Optional)
If you prefer to install it globally:
npm install -g create-gitnore
# Then use it directly
create-gitnore [template-name]Usage
Basic Usage
npx create-gitnore [template-name]Where [template-name] is the name of any template from the github/gitignore repository.
Examples
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 visualstudioAvailable Templates
This 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.
How It Works
- 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
Troubleshooting
Template Not Found
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
File Already Exists
This tool will overwrite your existing .gitignore file. Make sure to back it up if you have custom rules!
Tips
- 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
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
ISC
Links
Made with ❤️ by mwafa
