this is hypothetical at the moment, but it's a workflow I would like to put into practice.
I have a template that I start all of my web projects from. I am currently using github to store the master template, and simply cloning each time I build a project.
The problem is that as I do more and more projects, I had features that would be useful in the template, but it is tricky put them in using my current workflow.
What I propose is that I pull the template from github at the start of each project, and build the project along a local branch. When I come across something that I think will be useful in the master template, I switch to the master branch, implement the changes there, submit to github and then use reflog to bring those changes with me to the current, local project state.
Does this make any sense, and have I (as is likely) totally missed the point of reflog?
many thanks
I honestly still have no idea what you mean by "use reflog to bring those changes with me to the current, local project state". The reflog just displays past positions of a given ref. You still have to merge/rebase/cherry-pick to actually "bring" those changes anywhere else. Generally merging is the most elegant way.
For example:
Nothing complicated at all. Just merge the branch with the changes you want. This is probably obvious, but make sure you never pull the other way - from the local project into the template.
And of course, mess with your remotes as appropriate. You'll probably want to create a new "origin" for
local-project
, pointing to its central (e.g. github-hosted) repository, and the same fortemplate
. You could also point the template remote inlocal-project
to the central template repository instead of your local clone of it, if you like.