- or you could stop scratching your head so hard and actually use the gitignore templates for every programming language officially recommended by github itself - https://github.com/github/gitignore - funny how I did not see a single comment talk about this
.gitignore Everything by Default
131–140 of 182 posts
Re: .gitignore Everything by Default
#132~/.project-name/local.env
And then referring to that location in the repo, say from a docker compose file.
Works well so far
Re: .gitignore Everything by Default
#133This seems like bad advice. I've very rarely committed extra files by accident, but I would 100% forget to unignore files I meant to commit. If you're doing an initial setup step to gitignore everything, why not just do an initial setup step to gitignore the usual files? Make a template that you copy into all of your repos.
Most of the colleagues I've worked with only use "git add ." without checking first. Keys, npm directories and huge binaries are fixed by deleting them later on. The horror.
Keys that are deleted are not gone from the git history. They’re still in the repo.
Same with giant blobs and binaries.
Re: .gitignore Everything by Default
#134Earlier quoted context omitted.
Most of the colleagues I've worked with only use "git add ." without checking first. Keys, npm directories and huge binaries are fixed by deleting them later on. The horror.
> Keys, npm directories and huge binaries are fixed by deleting them later on. The horror. Keys that are deleted are not gone from the git history. They’re still in the repo. Same with giant blobs and binaries.
Re: .gitignore Everything by Default
#135Earlier quoted context omitted.
In my opinion this will pretty quickly solve itself though. Accidentally committing keys to the repo potentially ruins your entire week. With a default disallow all list, you might have one bad deploy oopsie and then commit the files.
One problem I see all the time is that people are not using proper tools. Yeah command line is cool and all but I do believe most of the developers should be using UI tooling where staging area is showing nice diffs. Built in GIT handling in IDE usually is better than command line but also usually worse than dedicated tool like GitExtensions or SourceTree which are free and are super convenient for staging. People do…
Re: .gitignore Everything by Default
#136Earlier quoted context omitted.
I have a small user-global gitignore that most of the job for me, ```.gitignore # Ignores ## Unix hidden files .* ## Temporary files and backups *~ *.swp *.bak # Exceptions !.ignore !.gitignore ``` But I tend to copy it over and extend it as I go, and there's well-known reference gitignore files to skim for if you have anxiety around any particular language/editor/tool. Now, I could extend my user-global ignore, but…
> Now, I could extend my user-global ignore I'd add .nvmrc and .npmrc if you work with NodeJS.
I think rules for your personal tools, like editor-specific ignores belong to your user-level config, but anything around the project's tools and artifacts belongs in the project's gitignore.
Re: .gitignore Everything by Default
#137Re: .gitignore Everything by Default
#138This seems like bad advice. I've very rarely committed extra files by accident, but I would 100% forget to unignore files I meant to commit. If you're doing an initial setup step to gitignore everything, why not just do an initial setup step to gitignore the usual files? Make a template that you copy into all of your repos.
Re: .gitignore Everything by Default
#139Earlier quoted context omitted.
It interactively shows you each change that would be added and lets you decide whether it should be staged or not. Down to the hunk level, so you can partially stage a file if you so choose.
Oh, that's neat. The -p presumably stands for pInteractive with a silent p :)
Re: .gitignore Everything by Default
#140Earlier quoted context omitted.
For many years I've have a git-ignored ".not-committed" folder in all of my repos for throwing extra anything into. It's been a huge life saver!
You can just add it in a user-level gitignore instead of ignoring it in every repo. See: ~/.config/git/ignore