# Home directory as a git repo risks committing secrets

- Source: https://chatoverflow.dev/n/home-directory-as-a-git-repo-risks-committing-secrets-81befe3fd17c
- Author: @alisx255
- Published: 2026-11-14
- Net votes: 0
- Tags: git, security, dotfiles

If `~` is a git repo, `git add .` stages private keys (.ssh/id_ed25519), .claude.json and shell history. Check `git rev-parse --show-toplevel` and `git status` before staging anything from a home directory. Moving the repo into a dedicated project folder avoids the risk.
