Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Gitignore Tree CopierNew to Visual Studio Code? Get it now.
Gitignore Tree Copier

Gitignore Tree Copier

TheLunatic

| (0) | Free
Copy file tree to clipboard while respecting .gitignore rules
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Gitignore Tree Copier

VS Code Marketplace License: MIT GitHub

Copy your project's file tree to clipboard while automatically respecting .gitignore rules. No more manually filtering out node_modules, virtual environments, or build directories!

✨ Features

  • 🚫 Respects .gitignore - Automatically excludes files/folders based on your .gitignore rules
  • 📁 Nested .gitignore support - Handles multiple .gitignore files in subdirectories
  • 🖱️ Context menu - Right-click any folder to copy its tree
  • ⌨️ Command palette - Use Ctrl+Shift+P → "Copy File Tree to Clipboard"
  • ⚙️ Configurable - Customize max depth, hidden files, and more
  • 📋 Clean ASCII output - Beautiful tree format ready for documentation

📦 Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Gitignore Tree Copier"
  4. Click Install

Or install from the VS Code Marketplace.

🚀 Usage

Method 1: Context Menu

  1. Right-click any folder in the Explorer
  2. Select "Copy File Tree to Clipboard"
  3. Paste anywhere!

Method 2: Command Palette

  1. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
  2. Type "Copy File Tree"
  3. Select the command
  4. The workspace root tree is copied to clipboard

📋 Example Output

my-project/
├── src/
│   ├── components/
│   │   ├── Button.tsx
│   │   └── Header.tsx
│   ├── utils/
│   │   └── helpers.ts
│   └── index.ts
├── package.json
├── tsconfig.json
└── README.md

3 directories, 7 files

Notice how node_modules/, .git/, and other ignored directories are automatically excluded!

⚙️ Configuration

Open VS Code Settings (Ctrl+,) and search for "Gitignore Tree Copier":

Setting Default Description
gitignoreTreeCopier.maxDepth 10 Maximum depth of tree traversal (1-50)
gitignoreTreeCopier.showHiddenFiles false Include hidden files (starting with .)
gitignoreTreeCopier.useGitignore true Respect .gitignore rules

Example Settings (settings.json)

{
  "gitignoreTreeCopier.maxDepth": 5,
  "gitignoreTreeCopier.showHiddenFiles": true,
  "gitignoreTreeCopier.useGitignore": true
}

🤔 Why This Extension?

Existing file tree extensions copy everything, including:

  • node_modules/ (thousands of files!)
  • Python venv/ or .venv/
  • Build outputs (dist/, build/, out/)
  • IDE folders (.idea/, .vscode/)

This extension solves that by reading your .gitignore and filtering automatically.

🐛 Known Issues

  • Very large projects may take a moment to process
  • Symlinks are not followed

📝 Release Notes

See CHANGELOG.md for version history.

🤝 Contributing

Found a bug or have a feature request? Open an issue!

📄 License

MIT © Darshil Doshi

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft