How to work with submodule?

2 messages, 1 author, 2016-06-15 · open the first message on its own page

How to work with submodule?

From: Steffen Prohaska <hidden>
Date: 2016-06-15 22:43:28

I tried to do some work on msysgit, but instead I'm fighting
with submodule for a while now. Maybe I haven't understood
something, but for submodule makes git nearly unusable.
Here is what I did.

msysgit ist organized in the following way.

/.git (clone of repo.or.cz/msysgit.git)
/git/.git (clone of repo.or.cz/git/mingw/4msysgit.git)

That is the root of the project is msysgit and as a submodule
git is included. Working on the submodule is fine.

But it I start to work on msysgit itself I get lost.

I have some changes in the submodule and just want to commit
some changes in the root, rebase to origin/master and push
to mob. To make it a bit harder I have some local changes
in the working tree.

This sounds quite simple, but I'm fighting with submodule
for quite some while now.

I think the root of all trouble is that I changed something
in the submodule git and now would like to change few things
in the root. I have a modified submodule and this messes
up everything.

I can't stash, I can't rebase.

I tried to commit the head of the submodule (btw, how should
I call this? I mean, the sha1 of the head of the submodule),
to get a clean git-status.

Now, I can't even switch branches.

How is this ment to work?
I have no clue how I should work with this mess?

I mean, I should be allowed to work on the submodule and somehow
work on the superproject at the same time? But none of my
usual workflow works because I always get trapped by a
modified submodule.

	Steffen

Re: How to work with submodule?

From: Steffen Prohaska <hidden>
Date: 2016-06-15 22:43:28

On Aug 10, 2007, at 9:02 AM, Steffen Prohaska wrote:
I mean, I should be allowed to work on the submodule and somehow
work on the superproject at the same time? But none of my
usual workflow works because I always get trapped by a
modified submodule.
What I do now is to check with 'git diff' in the supermodule,
which state of the submodule is expected. Then I bring the
submodule in this state (even if this brings me to a detached
head). This keeps the supermodule happy.

But if different branches of the supermodule expect different
states of the submodule you may be forced to switch to another
detached head after every command you run in the supermodule.
There must be a simpler way, which I probably don't know.

	Steffen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help