Global Gitignore VS Code Extension
This VS Code extension adds context menu items to the file explorer:
- "Add to Global Gitignore" - Adds a file or folder to your global gitignore file
- "Add to Gitignore" - Adds a file or folder to the project's .gitignore file
- "Add to .git/info/exclude" - Adds a file or folder to the repository's exclude file (local only, not shared with remote)
Features
- Right-click on any file or folder in the VS Code file explorer
- Choose from three options:
- "Add to Global Gitignore" - affects all repositories
- "Add to Gitignore" - affects the current repository and shared with remote
- "Add to .git/info/exclude" - affects only the current repository locally
- For global gitignore, if the path hasn't been set before, you'll be prompted to enter it (defaults to ~/.gitignore)
- For local gitignore, it automatically finds the .gitignore file in your project root
- For .git/info/exclude, it automatically creates the file if it doesn't exist
- Open commands available in the command palette (Cmd+Shift+P / Ctrl+Shift+P):
- "Open Global Gitignore"
- "Open .git/info/exclude"
Usage
- Right-click on a file or folder in the VS Code file explorer
- Select one of the three options:
- "Add to Global Gitignore"
- "Add to Gitignore"
- "Add to .git/info/exclude"
- The path will be added to the respective file
- You'll see a notification confirming the action
Requirements
Extension Settings
This extension contributes the following settings:
globalGitignorePath : The path to your global gitignore file (defaults to ~/.gitignore)
| |