views:

22

answers:

1

I'm fairly new to git, and I suspect the answer to this is no, but wanted to check with some of the more experienced git users here.

I have a superproject which has a commit which includes a reference to a development branch of a submodule. I'm a little worried that when I rebase that development branch onto master and delete it that the referenced submodule commit will disappear, making the superproject commit that references it unusable.


Though I've answered the question, it has brought up another question. Can this behavior be counted on? I've read that git keeps deleted items around in refs for a period of time, then removes them. Could this result in the clone working at first, then failing later?

A: 

Since I didn't get any answers, I decided to try it out. I made a project with a submodule and committed changes to the superproject with three different configurations in the subproject:

  1. The branch with the referenced commit was rebased onto master without any changes and the branch deleted.
  2. The branch with the referenced commit was rebased onto master with the referenced squashed into another commit.
  3. The branch with the referenced commit was simply deleted.

In all of these cases cloning the superproject with 'git clone --recursive' successfully added the submodule with the referenced commit.

JivanAmara