stablyai / stablyai/orca

[Feature]: Add "Add to .gitignore" option to File Explorer context menu

Open
#9,060 2 comments 0 reactions 0 assignees View on GitHub
collecting upvote enhancement
Dominant language
TypeScript
Stars
72.1k
Forks
4.7k
Avg merge
14h 54m
Merged PRs (30d)
520

Description

## Problem or use case

The File Explorer context menu currently offers actions like Copy, Copy Path, Rename, and Delete — but no way to quickly add a file or folder to `.gitignore` without leaving the editor.

When working with generated files, build outputs, or secrets that accidentally land in the worktree, the typical workflow is: open `.gitignore`, find the right section, type the path, save. This is friction that every other major editor (VS Code, JetBrains IDEs, Xcode) eliminates with a single context menu action.

## Proposed solution

Add an **"Add to .gitignore"** entry to the File Explorer right-click context menu, available for both files and directories.

Behavior:
- Appends the relative path of the selected item to the project root's `.gitignore` (creates the file if it does not exist).
- For directories, appends with a trailing `/`.
- If the path is already present in `.gitignore`, show a brief notice instead of adding a duplicate.
- Only show the entry for items inside a git repository (not plain folders).
- Refresh the File Explorer decoration state after writing so gitignored styling applies immediately (related: #1941, #2021).

## Screenshot — current context menu (missing the action)

![File Explorer context menu without Add to .gitignore](https://raw.githubusercontent.com/electro56435/orca/main/assets/context-menu.png)

## Alternatives considered

Manually editing `.gitignore` or using the terminal (`echo "path" >> .gitignore`). Both work but break flow inside the IDE.

Contributor guide

Open the contributing guide

Research direction

Start by locating the File Explorer context-menu entry point and the existing git decoration refresh flow. Trace how the selected item's relative path and repository root are determined, then inspect related issues #1941 and #2021. Done means files and directories can be added once to the repository .gitignore, only inside git repositories, with immediate decoration refresh.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, typescript
Domain
desktop, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.