AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Local Git Excludes

skill-m2laborg-agent-skills-local-git-excludes · by M2LabOrg

Use `.git/info/exclude` (per-clone, never pushed) or a global gitignore for personal / machine-local files instead of polluting the team `.gitignore`. Use whenever the user wants to ignore a file privately, asks "will my colleagues see this?", adds personal tooling / IDE configs / symlinks / scratch files to a shared repo, or any time you (the assistant) are about to add a line to a tracked `.git…

No reviews yet
0 installs
17 views
0.0% view→install

Install

$ agentstack add skill-m2laborg-agent-skills-local-git-excludes

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-m2laborg-agent-skills-local-git-excludes)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Local Git Excludes? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Local Git Excludes — Don't Pollute the Team .gitignore

The team's .gitignore is tracked and shared. Every line you add is committed and pushed for everyone to see. For anything personal — symlinks to your own dotfile/skills repos, scratch notes, IDE configs that nobody else uses, machine-local artifacts — use a local-only mechanism instead.

Three Mechanisms (Pick the Right One)

| Mechanism | Scope | Tracked? | When to use | |---|---|---|---| | Repo .gitignore | This repo, all clones | ✅ Yes | Build outputs, secrets patterns, anything every contributor needs | | .git/info/exclude | One clone of one repo | ❌ No | Personal files in a specific shared repo | | Global gitignore (core.excludesfile) | Every repo on this machine | ❌ No | Patterns you always want ignored everywhere (e.g. .DS_Store, *.swp, personal IDE folders) |

Decision Rule

Before adding a line to a tracked .gitignore, ask: "Would every contributor benefit from this rule?"

  • Yes → tracked .gitignore is correct.
  • No / only me.git/info/exclude (this repo) or global gitignore (all repos).
  • Unsure → default to .git/info/exclude. You can always promote it to the tracked file later.

Mechanism 1 — Per-Clone Exclude (.git/info/exclude)

Lives at /.git/info/exclude. Same syntax as .gitignore. Never pushed (the entire .git/ directory is local).

# Add a personal pattern to the current repo only
echo ".claude/skills/my-personal-skill" >> .git/info/exclude

# Verify it's working
git check-ignore -v .claude/skills/my-personal-skill
# .git/info/exclude:N:.claude/skills/my-personal-skill   .claude/skills/my-personal-skill

When you re-clone the repo, .git/info/exclude resets to the default. Either re-add the lines or use the global gitignore for patterns you want everywhere.

Mechanism 2 — Global Gitignore

One file, applies to every repo on the machine. Set it once.

# One-time setup
git config --global core.excludesfile ~/.gitignore_global

# Add patterns you always want ignored, anywhere
cat >> ~/.gitignore_global > .git/info/exclude

# 3. Verify
git status                              # should NOT list the file
git check-ignore -v .claude/skills/my-skill  # confirms which rule excluded it

Auditing Before You Commit

Before pushing changes to a tracked .gitignore, ask yourself again per line:

git diff .gitignore

For each new line: "Would I be comfortable explaining this to every reviewer?" If the answer involves "this is just my personal setup", move it to .git/info/exclude instead.

When You've Already Pushed Personal Stuff to the Team .gitignore

Don't panic — gitignore lines are harmless code. To clean up:

git checkout main && git pull
git checkout -b mdsm/cleanup-gitignore
# remove the personal lines from .gitignore
git commit -am "gitignore: remove personal entries (moved to local exclude)"
# add the same lines to .git/info/exclude on every machine you use
echo "" >> .git/info/exclude

Open a small PR, mention briefly that you're moving them to per-clone excludes.

Bonus — git update-index --assume-unchanged

For tracked files where you have local-only modifications you don't want to push (e.g. tweaking a config file that lives in the repo):

git update-index --assume-unchanged path/to/tracked/file
# undo:
git update-index --no-assume-unchanged path/to/tracked/file

Use sparingly — it can confuse you later. Prefer rewriting the file's design (template + gitignored override) when this comes up repeatedly.

Anti-Patterns

  • Adding .idea/, .vscode/, .DS_Store, personal symlinks, or WARP.md-style assistant configs to the team .gitignore "for convenience". They belong in the global gitignore.
  • Committing personal scratch notes "behind" a .gitignore rule for them — the rule reveals you have them.
  • Telling colleagues to put a specific line in their local .gitignore — give them the global-gitignore recipe instead.
  • Forgetting that .git/info/exclude is per-clone; treating it as if it follows the repo.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.