News for hackers. Stuff that matters.
Re:Idiot Proof Git by tremon on Wednesday November 09, 2022 @05:41PM (#33539119)
git add .

We have had multiple security incidents because some developer left a credential file inside the local git clone (no, not all tooling supports out-of-tree stored credential). Blind 'git add .' is the first thing I teach my developers not to do.

Re:Idiot Proof Git by ratorx on Wednesday November 09, 2022 @08:16PM (#33540861)
git add . is very useful though. Surely, the first thing to teach here is to always git status before committing?

My typical workflow is to git add . to see the mess I’ve made then decide how to clean it up. If I’ve mistakenly added a credentials file, the fix is to add it to the gitignore and unstage it, not JUST unstage it.

Not saying that you shouldn’t do both, but maintaining a gitignore and completely removing the potential problem for other people seems better than pretending your tool is more limited than it is.

Re:Idiot Proof Git by notpushkin on Thursday November 10, 2022 @02:31AM (#33543357)
If you can tolerate a GUI, Git Cola might be a solution. I'm using it exclusively for some 5 years now – it's lightweight enough, but still makes you think about what you're about to commit. You can add things to .gitignore directly from there, too.

https://git-cola.github.io/

Default layout is a bit weird IMO, here's what I'm doing instead: https://u.ale.sh/my-git-cola-screenshot.png

Re:Idiot Proof Git by krinchan on Thursday November 10, 2022 @09:43AM (#33547145)
You don't use .gitignore? All our projects use dotenv for local credentials with a .gitignore that covers build, log, and any *.env file.

Sounds like you need better tooling, tbh.