jesseduffield / jesseduffield/lazygit

Exclude option ignores core.excludesFile configuration

Open
#5,108 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

## Description

When ignoring files, lazygit currently offers two options:
1. **Add to .gitignore** - shared with all developers (tracked)
2. **Add to .git/info/exclude** - private, this repository only

However, git supports a third ignore location: `core.excludesFile` (typically `~/.config/git/ignore`), which is for **global user patterns** that apply to all repositories.

## Git's Three Ignore Locations

Per [git documentation](https://git-scm.com/docs/gitignore):

| Location | Scope | Shared? | Use Case |
|----------|-------|---------|----------|
| `.gitignore` | Project | ✅ Yes | Build artifacts, dependencies |
| `$GIT_DIR/info/exclude` | This repo | ❌ No | User-specific patterns for this repo |
| `core.excludesFile` | All repos | ❌ No | Editor files, OS files (e.g., `.DS_Store`, `*.swp`) |

## Feature Request

Add a third option to the ignore menu:
- **Add to global excludes** - writes to the user's `core.excludesFile`

This would be useful for files like:
- Editor backup files (`*.swp`, `*~`, `.idea/`)
- OS-generated files (`.DS_Store`, `Thumbs.db`)
- Personal tooling files

## Current Menu
```
Ignore or exclude file
> Add to .gitignore
> Add to .git/info/exclude
```

## Proposed Menu
```
Ignore or exclude file
> Add to .gitignore (shared, this repo)
> Add to .git/info/exclude (private, this repo)
> Add to global excludes (private, all repos)
```

I'm happy to submit a PR implementing this if the approach is acceptable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.