My goal is to add the k3s-ansible repo as submodule, into my repo. Since k3s-ansible
is an example repo, several files will require edits. Ideally, my main
branch will contain k3s-ansible
repo with all the customized files, while a k3s-ansible
branch will allow me to update any submodule changes, then merge them into my main
branch.
I'm not sure what is the correct way to achieve this.
Adding the submodule, into k3s-ansible
branch:
$ git checkout -b k3s-ansible
$ git submodule add https://github.com/k3s-io/k3s-ansible.git k3s-ansible
$ git submodule update --init --recursive
Example of sample directory, which will be named cluster
in my main
branch. In this example, the content will not create any collisions with original repo, since I use a different directory name. Another example would be site.yml, which will have a different content in my main
branch.
The part I'm missing is how to "import" the submodule changes from k3s-ansible
branch into main
branch, without changing any customized files or directories. Basically, I would need to ignore certain files or directories to be updated into main
branch.
Please let me know the recommended approach for my use case, thank you.