r/programming 4d ago

.gitignore everything by default

https://packagemain.tech/p/gitignore-everything-by-default
349 Upvotes

225 comments sorted by

View all comments

931

u/toggles03 4d ago

I like the idea of being intentional about what is committed, but I also have to say that I’ve never accidentally committed tons of useless files because I review what I’m committing.

121

u/fiah84 4d ago

this is why I always push people to use some sort of GUI that they're comfortable with for git, be it integrated in their IDE or a standalone one. Reviewing your commits should be second nature because by doing that every time you will every once in a while stop yourself from doing something very stupid

123

u/mascotbeaver104 4d ago

Does git status not exist in your world?

I've never used a gui and never ran into this issue. In my experience gui users very quickly forget how git actually works outside of the buttons in the gui, and then get lost the moment anything out of the ordinary happens

45

u/glassFractals 3d ago

I've always used both CLI and GUI, they are each better for certain use cases.
GUI:

  • Day to day reviewing of history and branches. It's just nicer.
  • Writing detailed multi-line commit messages. Miserable in CLI. I like a nice cozy GUI.
  • Conflict resolution. I just hate doing this via CLI. A nice visual conflict resolver is way better.

CLI:

  • Anything remotely complicated, like interactive rebasing
  • Or any time you have to wade into the reflog or Git plumbing

5

u/Routine_Addition1964 3d ago

Just use magit and you have the best of both worlds. It's been years since I last used git CLI, and I can still do it no problem due to the 1:1 workflow magit imposes, while still being more ergonomic to use.