Replacing old website - github workflow

Hi, I’m new to all of this so I’ll try my best to explain. I have an existing site on my master branch. It’s a simple static site that doesn’t use a builder. The client is rebranding and wants an entirely new website. I want to set up a staging site for them to review and then merge it into my master branch once it’s approved. So I created a new branch called update and enabled it in Netlify so it has the sub-domain update.

Where I’m getting confused is where do I set up the new site? Github desktop points to the same folder in windows regardless of the branch so I don’t know how to separate the two. Hope that makes sense… Thanks!

When using Git and in your case Git with a remote repository on Github, checking out a branch happens into the same directory. Once you make changes and commit those changes, your local Git checkout (update as example) will now hold those changes. Once you push those changes up to Github, the branch will now be updated into your repository. This is the way Git workflow works. It allows you to commit changes locally and checkout branches so you can work on them.

Many years ago when I was learning Git, I would create a test repository and test out the workflow, so I could see how these changes happen. It might be a good idea for you to try that out, so you can feel more comfortable. There are some good articles on the web for resources explaining how Git workflow works. It can be daunting at first.

Netlify uses this same workflow to checkout a branch when it builds your site or checks it out for publish. Although Netlify does not make changes to your repository, the checkout is the same.

2 Likes