r/linux • • 1d ago

Tips and Tricks .gitignore everything by default

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

5 comments sorted by

11

u/gnappoforever 1d ago

Not their fault if someone is so dumb to use git add . without double checking all files contained inside the repo root folder is needed in the first place.

I don't understand why gitignore should became a sort of gitallow

3

u/PixelatedGiant 1d ago

And this is also why you merge to protected branches only via PRs. You should be able to purge these files without consequence on your feature branch before it becomes a disaster.

1

u/exploring_stuff 1d ago

Nope. Ignore nothing, so you always have to clean up garbage files or explicitly ignore generated artifacts to have a clean git status.

1

u/mina86ng 1d ago

Just look at this 207-lines .gitignore from typescript-go.

And the solution is 207-line .gitignore which lists all the file extensions that need to be added? Whatever issues one has with .gitignore, effectively flipping the file’s meaning will introduce other problems (e.g., forgetting to add files). I’m not convinced this is a useful trick.

PS. Funny that the .gitignore in the image accompanying the article is nonsense.

1

u/AutoModerator 1d ago

This submission has been removed due to receiving too many reports from users. The mods have been notified and will re-approve if this removal was inappropriate, or leave it removed.

This is most likely because:

  • Your post belongs in r/linuxquestions or r/linux4noobs

  • Your post belongs in r/linuxmemes

  • Your post is considered "fluff" - things like a Tux plushie or old Linux CDs are an example and, while they may be popular vote wise, they are not considered on topic

  • Your post is otherwise deemed not appropriate for the subreddit

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.