I have been trying to figure out the best way to logically handle this situation. I have a website and a staging version of it for testing new features/testing bug fixes. I find that I will often be working on multiple projects in the same files at the same time.
The problem is, say I am working in example.js on Project A. I get a good amount of it done, or maybe all of it done but it will take a while to test since it's a long project. In the meantime, I start working on Project B, which involves editing the same file, example.js. Project B is just a quick bug fix and it is ready to be uploaded to the live server. But how to I upload example.js to the live server with the Project B changes and without the Project A changes because Project A has not yet been fully tested?
I thought of using Github and just creating a different branch for every project that I'm doing and just pulling the Github repo down to the live server, but I can't put it together in my head. I'd be making these changes for all projects directly on the staging server so I can see them immediately on the staging version of the website.
If someone could help me put together a good process to go about this, it would be a big help.