I am in the process of making a simple website with informational content and I am interested in keeping a raw html version of my website (that is without any divs or other things that are used to style the website) with pure content apart from a version with css applied for styling. I am thinking about using git and multiple branches to achieve this. My branches would be:

  1. raw-html
  2. style-1
  3. master

My intended workflow would to create new content in the raw-html branch, merge it into style-1, style it with css and then when take it to master which will be what people will see. If content needs to be updated I would go into raw-html and modify content and merge the changes into style-1 and that would eventually end up in master.

The idea behind this is that at any time I want to re-do the appearance of my website I would just create a new branch from raw-html, call it style-2, style the website differently and then merge it into master.

  • It sounds like your approach could work, but whether or not it is the best approach (or a good approach) sounds like a matter of opinion. Aug 1 '19 at 9:08

You have the HTML of your site. Then you create CSS stylesheet files that upon inclusion modify your site's appearance. If you want to remove the style, you just remove the CSS stylesheets and you are left with pure HTML and content. If you want to modify the site's appearance you just include a different set of CSS stylesheets to your HTML. No reason to have multiple branches.

  • I am aware that I can have separate css files to change the appearance but I would like to keep a very clean copy of my html code with mostly h1's, p's , and other semantic markup instead of design markup.
    – 1028
    Jul 30 '19 at 2:15
  • @1028 What is "design mark up"? You have the mark up, which is HTML and you have the CSS that modifies it. HTML code can not have just "h1s and p's". It has all the HTML code of your page. What you describe is a separation of styling and mark up. And by having HTML separate from CSS and including the latter as stylesheet instead of writing it inline or appending it with <style> tags, you achieve just that. If you want something else please modify your question to reflect that. Aug 1 '19 at 10:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.