Skip to main content

ensure_in_git_exclude

Function ensure_in_git_exclude 

Source
pub fn ensure_in_git_exclude(repo_path: &Path, entry: &str) -> Result<()>
Expand description

Ensure an entry (e.g. “.devprune.json”) is in the repository’s .git/info/exclude.

The exclude file, not .gitignore: the config records one machine’s preferences, and .gitignore is a tracked file shared by everyone who clones the repository — appending to it silently puts an uncommitted change in the user’s diff. The exclude file gives the same “never shows up in git status” result without touching anything the repository tracks.