Reputation: 61
I’m new to git, My scenario is as follows: I have patches made to a linux kernel on a private project. I want my local repository to hold these patches. Not the entire kernel. I ain’t talking about .patch files but rather hold the files i’m actually changing.
So that when i want to apply them on a different kernel i’ll simply pull them into the second kernel folder.
And now for the problem: I need to be able to switch the base tree once in a while, or, to simplify the scenario, i want to be able to pull a different tree and the pull my patches-repo into it.
But the actual second kernel is a repo, and my patches are a repo as well. So i cannot combine them both in the same folder while still having source control for both.
Is there a way to glue the repos or tell git one is the parent and one is the child and it will auto-merge and pull everything automatically ?
Regards David
Upvotes: 1
Views: 52
Reputation: 3897
Is there a way to glue the repos or tell git one is the parent and one is the child and it will auto-merge and pull everything automatically ?
This is basically the purpose of git submodule
but they won't auto-merge. A submodule has to be at least in a given subdirectory in the main repo.
However, if your Linux hack is not about patching existing official files, but writing a distinct kernel module that could be loaded with insmod or modprobe, then you don't need at all to develop inside the kernel tree. Just designate a regular directory somewhere in which you'll do all your development, then ask the top-level linux makefile to compile it for you from here :
make -C /lib/modules/`uname -r`/build M=`pwd` modules
Upvotes: 1