Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to track my $HOME dir with git. I've got many other git repos in other subdirs (eg $HOME/projects/repo_1 and so on), which shouldn't be tracked, since they already are.

I have found git-home-history but it appears from the archive that the project is no longer actively developed.

What approach do you recommended? Is ghh mature enough?

I am on a Mac but I am interested in cross platform solutions, too.

Thanks

ps: I have looked but didn't find duplicates, please point them out if this has already been discussed.

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

I've been doing this for a while just using git. I don't track the entire home directory, just the parts that I am actively changing. This includes my home/bin directory, which contains lots of little scripts, my .vim directory, and some larger projects in other directories. Also there are some configurations for terminals and openbox, as well as various other apps, added to the repo.

This works well enough since all of this stuff has the same permission set and I don't care about the original timestamp. It's getting to the point where I'm planning to break some of it out into submodules using git filter-branch. This is a bit tricky though since there are interdependencies between files in different subdirectories (eg some .vim scripts might call scripts from my bin directory... not a very good example but hopefully you get the point).

I haven't found any more comprehensive solutions, but also haven't really looked into any, including git-home-history. It seems like it would be pretty complicated to put the entire home directory under revision control, and there would be a lot of variables. For instance if you put your firefox profile(s) under revision control, you're going to end up piling up huge amounts of binary differentials. Also there are things like ssh keys that are often better lost than duplicated.

If you do want to track permissions (other than the executable bit, which git already tracks) there is apparently a hook that will do that. It's mentioned in this serverfault thread.

share|improve this answer
    
You understood my use case: in fact I am interested in versioning scripts and configurations. I will go with this basic approach. –  Francesco Apr 19 '10 at 12:06
    
FYI: The problem that I'm running into these days is that I don't want to branch my .vim directory when working on new components. I'm considering a bunch of different approaches: I'll probably end up splitting it into a separate module using filter-branch, and setting up a 'work in progress' clone of it in a subdirectory of ~. This seems to be a generally useful strategy: I expect that it will be similarly useful to clone my entire home dir repo, then test scripts after setting $HOME to the clone directory. I'm not sure how universally respected that environment variable is but I'll see. –  intuited Apr 20 '10 at 22:28
add comment

You can use git on your home directory, then use git submodules or revise-tree for the external git projects that you work on.

share|improve this answer
add comment

Here's an article with a step-by-step guide for doing what you want:

http://pyverted.com/linux/setting-up-version-control-on-your-home-directory/2009/08/

share|improve this answer
    
This link does not work any more –  Cougar Nov 27 '11 at 18:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.