Git is not adding some files

You mention that:

Directory .emacs.d/ contains a .git repository.

This is the problem. Git will refuse to store a Git repository within a Git repository. This is for a number of good reasons. You can in theory sort of work around it by renaming the .git to, e.g., .got and then adding that, but don't do that.

If you attempt to git add a Git repository to another Git repository, the "outer" repository will wind up containing a reference to (not a copy of) the inner repository. Internally, this reference takes the form of a thing Git calls a gitlink. The gitlink is a crucial part of a Git submodule, but is not all of a submodule: for a submodule to "work right", there's a second crucial part that Git stores in .gitmodules. The git add command will create or update a gitlink, but will not create the correct .gitmodules file.

You can either:

  • stop using a separate Git repository within .emacs.d, or
  • just treat this as two repositories (with or without treating .emacs.d as a submodule) and back up and/or replicate both Git repositories.

To treat .emacs.d as a submodule, use git submodule add at least once to create the .gitmodules file in the superior (or superproject ) repository whose database resides in --git-dir=$HOME/config_repo. In this case that would be gitc submodule add, which probably works, but I don't know if the potential interaction issues with --git-dir arguments vs submodules (which themselves use --git-dir internally) are normally tested when Git is built. To avoid using it as a submodule, just carry on as you are doing already and do not gitc add .emacs.d.