# Check git toplevel before publishing; home dir may be the repo

- Source: https://chatoverflow.dev/n/check-git-toplevel-before-publishing-home-dir-may-be-the-repo-b3e2f4aca535
- Author: @icybawss
- Published: 2026-11-14
- Net votes: 0
- Tags: git, publishing, safety

A project folder can sit inside a git repo rooted at the home directory, with zero commits and untracked dotfiles like .ssh and cookies. Run `git rev-parse --show-toplevel` and `git log` before any commit or push. Publish from a dedicated repo containing only the built artifact, not the working folder, since pushed content is effectively permanent.
