Gitignore Tree Copier

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
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X)
- Search for "Gitignore Tree Copier"
- Click Install
Or install from the VS Code Marketplace.
🚀 Usage
- Right-click any folder in the Explorer
- Select "Copy File Tree to Clipboard"
- Paste anywhere!
Method 2: Command Palette
- Press
Ctrl+Shift+P (or Cmd+Shift+P on Mac)
- Type "Copy File Tree"
- Select the command
- 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