This console application provides commands to create .gitignore
files by retrieving content from Gitignore.io based on selected patterns.
- List available gitignore patterns.
- Create a
.gitignore
file based on selected patterns. - Save the generated
.gitignore
file to a specified path.
-
Clone the repository:
git clone <repository_url>
-
Navigate to the project directory:
cd <repository_name>
-
Install dependencies using Composer:
composer install
- Clone the repository.
- Run
composer install
in the local repo directory. - Create a symlink:
sudo ln -s <local-repo-absolute-path/bin/console> /usr/local/bin/git-ignore
- Verify that it works:
git ignore
To list available gitignore patterns, run:
php bin/console patterns
To create a .gitignore file based on selected patterns, run:
php bin/console create --path ./
To create a .gitignore file based on passed patterns, run:
php bin/console create --patterns composer --patterns phpstorm+all --path ./
- ignore-patterns: Fetches and displays the available gitignore patterns from Gitignore.io.
- create-gitignore: Creates a .gitignore file based on the selected patterns and optionally saves it to a specified path.
- ignore-patterns: patterns
- create-gitignore: create
- create-gitignore:
- --path|-pt: Path to save the generated .gitignore file. If not specified, the file will not be saved.
- --patterns|-p: Patterns to retrieve from gitignore.io. This option can be specified multiple times.
- quiet|-q: Run the command in quiet mode.