GIT – Best Practices for Maintaining Web Application Templates

gitweb-applicationsweb-development

I am a sole developer and I have a web application template that I have created in Visual Studio. I am using GIT for source control, but only on my development machine. Presently I have a master and I create branches for new features, merging them back in to the master as I complete the features.

I am at a point now where I am ready to use the template for deployments, and of course I want to continue adding new features via branching/merging.

My question is: what would be the typical/recommended way for me to create application deployments based on the master? Should I clone the repository into a new directory that is for a particular web application? Or should I also use branching to do project development based on the main project?

The projects would never be merged back into the master. However, it would be nice if I could merge future features into the master and have the ability to incorporate them into previously completed projects if desired.

For more specific details of my environment: I am using TortoiseGIT in Windows 7, Visual Studio 2012, ASP.NET Web Pages. Obviously the main differences between deployments would simply be differing pages, CSS files and jQuery scripts.


I found this post as I was writing this one. In order to do this should I clone the master repository and checkout from it?

Best Answer

I think your idea of cloning your template is best. But you can tweak that by using GitHub or similar site.

With GitHub you would fork for each new project based on your template.

The fork would create a brand new git repository but based on your template.

Now if one your projects has an update you would like picked up in your original template repository, you could submit a pull request to the original template. Others could too, if you wanted to share.

Then you would simply accept the pull requests you found that you want to incorporate into your original project.