For what it's worth, my approach to this is simply to put the repo in
~/.home.git and create an alias for 'git --git-dir="$HOME/.home.git"',
wildcard ignore everything, then add back in a few things. I'd
definitely think about something like this or Brett's version, since
it's much more extensible if you ever decide to track anything
If you really want to move your repo inside .emacs.d, you presumably
want all the paths to be 'path/to/file' not '.emacs.d/path/to/file' -
otherwise you haven't solved the `git status` problem. This sort of
rewriting history is a job for the subdirectory filter of git-filter-
branch. For example:
git filter-branch --subdirectory-filter .emacs.d -- --all
will remove all information about anything not in .emacs.d from the
repository, and rewrite everything in it to remove that prefix from
the path. You said you 'almost' have only the .emacs.d directory...
hopefully that means you can figure out what to do with the bits that
aren't in it. If there is anything tracked outside the .emacs.d
directory, you'll probably want to do the filter-branch in a clone so
that it doesn't blow away important stuff in your home directory.
As for submodules, I haven't yet had occasion to try that feature out,
so I'm not the one to ask.
On Sep 8, 7:44 am, Andrea Crotti <kerny...@gmail.com> wrote:
> I have a git repository which is situated in $HOME.
> The purpose was to store there all my more important configuration
> files, but I have almost only my ".emacs.d" directory.
> Now every time I do e *git status* it takes a long time because it
> looks for all the rest.
> So I have two options:
> - automatically ignore all the files which are not the ones that I
> - move the repository inside .emacs.d
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To post to this group, send email to firstname.lastname@example.org
To unsubscribe from this group, send email to
For more options, visit this group at