From: Michael Gorbach <michael@mgorbach.name>
To: git@vger.kernel.org
Subject: git submodules and custom work tree / git dir
Date: Fri, 9 Dec 2011 16:48:22 +0000 (UTC) [thread overview]
Message-ID: <loom.20111209T173452-58@post.gmane.org> (raw)
I am working on a setup for managing my personal config files
(shell settings and vim settings and such) using git.
I have a git repository which ignores all files by default, so they don't
cloud status. I have the following aliases:
alias config='git --git-dir=$HOME/.config.git/ --work-tree=$HOME'
alias config-add='git --git-dir=$HOME/.config.git --work-tree=$HOME add -f'
This works pretty well. It means that the config repo is separate from other
git repos, and I won't accidentally touch it by just typing "git."
What I'm trying to do now is to track vim (bundle) modules inside this git
repo, which requires the use of git submodules.
It appears that submodules don't work with this weird configuration.
By calling git as in the "config" alias above, except removing the --work-tree
argument, I was able to add submodules successfully with git submodule add. The
submodule info is written into .gitmodules and .config.git/config as expected.
However, the submodule doesn't seem to "stick." It displays when I type
"config status" as "untracked content" no matter what I do, even though
there is no untracked content and no change in the submodule.
Is there a way to make submodules work reasonably with git when using the
--work-tree and --git-dir arguments?
reply other threads:[~2011-12-09 16:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20111209T173452-58@post.gmane.org \
--to=michael@mgorbach.name \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox