11

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.

2 Answers 2

5

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.

2
  • 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, 2010 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, 2010 at 22:28
0

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

1
  • What does $Home mean here?
    – gyuunyuu
    Oct 18, 2020 at 23:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .