Hacker News new | past | comments | ask | show | jobs | submit login

I only use private repos, so that when my .ssh and .env leaks the public doesn’t see it. Probably. Maybe. Well…





Git implemented a `.gitignore` file for this exact purpose. One of the first things to do when you create a new repo is to customize if for the language + OS.

And .env is implemented for this exact purpose too, hand-in-hand with .gitignore ;)

But mistakes happen all the item. It's very easy to fat-finger a line in .gitignore - one char off and you're toast.


Just remember to go through your commit history if you ever plan on making that repo public.

I commonly flatten repos (by copy and create) when I share them. Its rare that the other person needs the commit history.

I have often thought it would be nice to have a good tool to retroactively view and tidy them, but everything I've seen has not quite hit the nail on the head.


I use the Pieter Levels commit history strategy of all my commit messages being the single word "commit"

https://x.com/levelsio/status/1590908364393156608




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: