Skip to content

Latest commit

 

History

History
73 lines (46 loc) · 1.74 KB

README.md

File metadata and controls

73 lines (46 loc) · 1.74 KB

gitignore updater

A flexible tool to update your .gitignore file with common patterns for various programming languages and environments.

Features

  • Easily extendable to support new pattern sets
  • Command-line interface with flags for each supported pattern set
  • Automatically creates .gitignore file if it doesn't exist
  • Adds patterns without duplicating existing entries

Installation

To use this tool, you need both the main script and the patterns folder. To get started:

  1. Clone the repo
git clone https://github.com/griffinbaker12/git-ignore-updater.git
cd git-ignore-updater
chmod +x git_ignore_updater.py
  1. Set up an alias (optional, but recommended)

Add this line to your shell configuration file (e.g., .bashrc, .zshrc):

alias update-gitignore="./path/to/git_ignore_updater.py"

Replace /path/to/git_ignore_updater.py with the actual path where you saved the script.

Usage

Run the script in your project directory:

./path/to/git_ignore_updater.py [OPTIONS]

Or, if you set up an alias:

update-gitignore [OPTIONS]

Options

  • --python: add Python patterns (default if no options selected)
  • ... (insert your custom option here)

You can combine multiple options:

./git_ignore_updater.py --python --your-custom-option

Adding New Patterns

  1. Navigate to the patterns directory.
  2. Create a new text file named after the language or environment (e.g., rust.txt).
  3. Add the patterns, one per line.
  4. The script will automatically recognize the new pattern set and add a corresponding command-line option.

Contributing

Please feel free to open a PR to add a cli argument for any patterns that you catch yourself typing a lot!

License

MIT License