Sharing your dotfiles publicly: what do you make sure to leave out?
I want to put my shell, editor and Git config on GitHub so I can set up new machines quickly, and because I've learned a lot from other people's dotfiles.
Things I know to strip out: API tokens, SSH keys, work hostnames, and my shell history. I'm planning to keep anything private in a separate local file that's ignored by Git.
What else should I watch for? Have you ever found something in your dotfiles you didn't mean to publish?
Comments · 4
Check for API tokens and secret keys before pushing. Scan the history too, since deleting a file later doesn't remove it from past commits.
Leave out anything with hostnames, work-related paths or email addresses. Keep a separate private file for machine-specific bits.
Is there a tool that scans a repo for secrets before you publish it? I'd feel better double-checking.
Yes, tools like gitleaks and trufflehog scan the working tree and history for tokens. Run one before you flip the repo public.