
Ask HN: Turn my home directory into a Git repo? - mangeletti
I&#x27;m on OS X, but this question is of course relevant to Linux as well:<p>I was thinking of making my home directory into a Git repo, so that I could easily see when new files (hidden or otherwise) are added by programs I use, and so that I could just generally track changes. I would probably add directories like Music, etc. to .gitignore to avoid bloat.<p>Some of the things that would be interesting to notice are all the little hidden configuration files that build up over time, e.g.:<p>.android, .bash_history, .bash_profile, .bash_profile.pysave, .boot2docker, .cache, .cleanup, .config, .cups, .docker, .fctsslvpnhistory, .filezilla, .gitconfig, .heroku, .ipython, .local, .netrc, .node-gyp, .npm, .oracle_jre_usage, .pip, .putty, .python_history, .swt, .thinkorswim, .v8flags.3.28.71.19.me.json, .vim, .viminfo, .virtualenvs<p>Do you have any thoughts on doing this? Is it a terrible idea?
======
tombert
I actually version control my config files
([https://github.com/tombert/dotfiles](https://github.com/tombert/dotfiles))
after reading this tutorial:[http://brandon.invergo.net/news/2012-05-26-using-
gnu-stow-to...](http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-
manage-your-dotfiles.html)

Obviously you should change that to git instead of CVS.

~~~
stoe
tombert is right. dotfiles are the way to go.

Maybe find some additional info on
[http://dotfiles.github.io/](http://dotfiles.github.io/) to get you started.

------
twunde
This depends on how you manage your computer. If you put all your personal
projects in your home directory this could be a pita. Really what you'll need
to do is to make heavy use of gitignore. Obviously bash_history changes on
every command so that may be one you want to avoid tracking. You may also want
to take a look at dotfiles repos on github, which are meant for actively
tracking your configuration files instead of seeing what new files have been
added.

------
ianleeclark
I do something similar, so I know it's feasible. I whitelist the dotfiles that
I want to keep hold of (.vim, .bashrc, &c.) in my homefolder and whenever I
update something, I just push to the remote.

It's really enlightening to see just how quickly a perfectly clean home folder
can get filled with hidden directories.

------
meagher
You could separate the work tree and git directory in your home folder. Works
like a charm for me!

[https://fuller.li/posts/organising-dotfiles-in-a-git-
reposit...](https://fuller.li/posts/organising-dotfiles-in-a-git-repository/)

------
deepaksurti
You can also refer to this recent post around managing dot files:
[https://news.ycombinator.com/item?id=11071754](https://news.ycombinator.com/item?id=11071754)

------
coppolaemilio
It is an interesting idea. I would recommend you to start and then make the
.gitignore grow with things you don't need. Your list is already big enough to
start. Looking forward to see how your experiment goes.

------
mbrock
Just put * in your gitignore. Then everything you don't add is ignored.

Edit: Oh, this doesn't help you with seeing what new stuff is added, at least
not in the root of the tree. But it's a useful trick.

------
mangeletti
Thanks everyone herein for the advice!

