First off, if you can find the HTC source as an existing git repository, you will be much better off. The lack of proper git history in your manually constructed tree is inevitably going to cause conflicts. The HTC source is effectively a branch off vanilla Android, which is (presumably) a branch off vanilla Linux, but without the full history, git can attempt nothing better than an effective two-way merge, since it doesn't have the common ancestor in order to do a proper three-way merge. So unless you are an experienced kernel programmer who can handle these conflicts, I expect you will have great difficulty.
Anyway, if obtaining the full history is not possible, your trees will not have a common root, so you will need to consult How do I join two git repos without a common root, where all modified files are the same?.
Regarding the .gitignore
issue, if you have files which are ignored in the 3.0.8 tree but tracked in the 3.0.41 three then it sounds like you have a mismatch between the .gitignore
files in each tree, so you should compare them, try to figure out why, and decide what should be tracked and what shouldn't. git blame .gitignore
in the 3.0.41 tree might help with this. The 3.0.41 tree will be the more authoritative of the two repositories, since it has complete history and will be internally self-consistent, so you could try transplanting its .gitignore
into the 3.0.8 tree before your initial import commit. Also be aware that there could be .gitignore
files anywhere in the tree, not just at the top-level (I don't know off-hand if the Linux kernel does this).