Skip to content

Instantly share code, notes, and snippets.

@devinci-it
Created May 11, 2024 17:46
Show Gist options
  • Select an option

  • Save devinci-it/e96f5e335a458e97226514b14e49b6f0 to your computer and use it in GitHub Desktop.

Select an option

Save devinci-it/e96f5e335a458e97226514b14e49b6f0 to your computer and use it in GitHub Desktop.
This Gist contains `.gitignore` templates tailored for different types of projects and environments. `.gitignore` files help ensure that certain files or directories are not tracked by Git, which can be useful for ignoring build artifacts, editor-specific files, and other generated files.

Useful .gitignore Templates

This Gist contains .gitignore templates tailored for different types of projects and environments. .gitignore files help ensure that certain files or directories are not tracked by Git, which can be useful for ignoring build artifacts, editor-specific files, and other generated files.

Usage

  1. Choose a Template: Browse through the available .gitignore templates in this Gist and select the one that best matches your project's requirements.

  2. Copy the Content: Open the chosen .gitignore file and copy its content.

  3. Create or Update .gitignore: In your project's repository, create a new .gitignore file if one doesn't already exist, or open an existing one.

  4. Paste the Content: Paste the copied content into your .gitignore file.

  5. Customize (Optional): Modify the .gitignore file as needed to include additional patterns or to exclude specific files or directories relevant to your project.

  6. Commit and Push: Save the changes to your .gitignore file and commit them to your Git repository. Ensure that any previously tracked files that are now matched by the .gitignore rules are removed from the repository using git rm --cached <file>.

Templates

  • Python: py.gitignore

    • Ignores Python bytecode files, cache directories, and common virtual environment directories.
  • JavaScript: javascript.gitignore

    • Ignores Node.js modules, npm/Yarn lock files, and other common JavaScript-related files and directories.
  • Visual Studio Code: vscode.gitignore

    • Ignores Visual Studio Code-specific files and directories.
  • JetBrains IDEs (e.g., PyCharm, IntelliJ IDEA): jetbrains.gitignore

    • Ignores JetBrains IDE-specific files and directories.
  • Miscellaneous:

    • dir.gitignore: Ignores the entire directory where it is added.

Contributing

Contributions to this Gist are welcome! If you have a .gitignore template that you believe would be useful for others, feel free to fork this Gist and create a pull request to add it.

License

This Gist is licensed under the MIT License.


These adjustments should polish the README. Let me know if you need further assistance!

# JetBrains IDEs
.idea/
*.iml
*.ipr
*.iws
# User-specific files
.idea/workspace.xml
.idea/tasks.xml
# Project files
*.idea/modules.xml
*.idea/dictionaries
*.idea/vcs.xml
# Node.js
/node_modules
# npm
*.log
*.lock
package-lock.json
# Yarn
yarn-error.log
# Bower
bower_components
# OS generated files
.DS_Store
Thumbs.db
# Editor directories and files
.vscode/
.idea/
*.sublime-project
*.sublime-workspace
# Build output
/dist/
/build/
__pycache__/
*.py[cod]
*$py.class
.vscode/
.idea/
*.pyc
*.pyo
*.pyd
.env
.venv/
venv/
env/
ENV/
env.bak/
venv.bak/
# Visual Studio Code
.vscode/
*.code-workspace
# User-specific files
.vscode/settings.json
.vscode/tasks.json
.vscode/launch.json
.vscode/extensions.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment