The .gitignore
file exists in almost every of our projects, but even across similar projects the .gitignore
always looks different.
Cheers
The .gitignore
file exists in almost every of our projects, but even across similar projects the .gitignore
always looks different.
Cheers
For further actions, you may consider blocking this person and/or reporting abuse
Axel Navarro -
Samuel K.M -
Ben Halpern -
Jagroop Singh -
Top comments (22)
Every time I start a new project I just download a .gitignore from Github/gitignore
Recently I found out there's a VSCode extension which does that for me.
I feel like I saw this before, but this is a great resource. Thanks!
When I start a project, I go to this site to create
.gitignore
.Since I'm using JetBrains's IntellIJ IDEA most the time, my
.gitignore
is normally just:This makes sure I'm not committing any IDE generated files on my Java/Kotlin projects.
For those who might not be familiar with the
*.iml
, it tells Git to ignore any files names that end on.iml
. This can be done to any kind of files too.The first 2/3 or more dates from before I took over the project, so now I'm curious what those regexes are doing...
Looks like a pattern to ignore vim swapfiles
Mine's pretty simple, for my apps.nektro.net project this is it
Can I do a promote a tool here for those who like building random projects?
npmjs.com/package/gitignorer
It is a tool that allow you to init gitignore file easily given a default profile.
Gitignore for my $HOME directory (inverse of the usual, ignore everything except some files) and a typical project (with a bunch of project specific files)
Why do you need a gitignore for your $HOME?do you use this as a template?
For provisioning and syncing between computers. I keep my
$HOME
directory in source control, just the files listed there (probably unwise to store.ssh
in source control). Since I use the same settings (bashrc
,bash_aliases
, vim settings) between my desktop, laptop, server, and phone, I keep these in source control.This also means that if I want to do a clean upgrade (complete reinstall without keeping junk) I can quickly get a new setup and I'm up and running. I only do this once a year or so, but on several different computers it just makes the process easier.
I also have a separate
.config
in source control (see below), since my phone doesn't need that, and a headless server wouldn't need the same GUI config files.This is also useful for keeping productivity tools, scripts, settings all in one place. The company I worked for before set me up with a laptop so it was just a matter of installing git and running a couple commands to optimize my workflow.
I used to only have one for
~/bin
, since I have a few hundred bash scripts in there (only use about 20 regularly), but I soon expanded to most of my home directory after a few reinstalls.I like to have two .gitignore, one for me (a global one), and one for the project that I'm working on.
In my global gitignore, named
.gitexcludes
(github.com/diegoholiveira/dotfiles...), I ignore files that are generated by my own environment, like IDEs files, vagrant files and others.In my projects, my
.gitignore
only have entries that are directly about the project: like build files, pyc files and vendor folder, generated files and other.This helps me to keep things very organized.
A really great approach! You must be a good project collaboration mate.
Cheers!
My Rails 5 app:
From a gem that I made via a plugin generator: