I'm wondering if this is going to work...
Say i have a project template something like that:
.
+ resources/
+ images/
1.png
2.png
I want to use this project as a template for other projects, so they would be essentially "cloned" from the template but maintained as a separate repository.
However, I would still like to be able to pull updates from the template whenever they occur (but don't care to push to it).
Submodules or subtree merge don't seem to fit here because it is not cloned into a sub-directory; it's effectively "mapped" to the root directory or the new project.
One one I think could work would be something like this:
#setup project
mkdir proj1
cd proj1
git init.
touch .gitignore
git add .gitignore
git commit -m "Initial Commit"
#setup main repo
git remote add origin git@server:proj1.git
git push origin master
# load template repo as separate remote
git remote add -f template git@server:template.git
# import into current master
# here I guess I have the choice of either:
git merge template/master
# OR
git rebase template/master
Then later on the template project is updated:
.
+ resources/
+ images/
1.png
2.png
3.png <-added file
I should be able to do a git pull template master
to pull the changes from the template and repeat the last merge/rebase steps to integrate into the project.
Is that the correct approach, or is there a better way to do this?
Am I going to run into some trouble with this down that track?
Thanks