DEV Community

Discussion on: Show me your .gitignore

Collapse
 
tadaboody profile image
Tomer

Why do you need a gitignore for your $HOME?do you use this as a template?

Collapse
 
pmcgowan profile image
p-mcgowan • Edited

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.

*
!.gitignore
!user-dirs.dirs
!gtk-3.0/
!gtk-3.0/**/*
!google-chrome/
!google-chrome/Default/
!google-chrome/Default/Bookmarks
!mc/
!mc/**/*
!sublime-text-3/
!sublime-text-3/Packages/
!sublime-text-3/Packages/User/
!sublime-text-3/Packages/User/**/*