For any project i work i have the following workflow, first what i have setup:
- Dev environment, local for your own changes, in a server for testing, code review, if you are only one person you can just do it in the server, there is also multisite.
- Production, or live environment.
- The project is versioned in github.
- There are 2 branches
masteranddev. - Loading the repo in my IDE (you can also work remote and have the repo locally, i use Netbeans).
Now the workflow is:
- An update is requested (a fix, feature etc).
- I create a branch from the dev branch and name it something like
fix-bug-23. - I commit the changes and create a pull request to be code reviewed and merged to
devif good. - When the week is complete,
devhas all the updates that were completed in that week (i use scrum so there needs to be a “time-box” 1 week in this case) . - The
devbranch is QAed so it can be merged tomaster devis merged tomasterif all is good then then there is a test in prod for the updates.
This way you can also work within a team so everyone will do his branch for his update, if you are only 1 person you can just commit directly to dev.
dev-> dev enviromentmaster-> prod/live environment
if you have access only to the dev server thats ok, just make sure the person who is uploading to prod, uses the master branch.
if you need something that needs to be in prod right away, create a hotfix branch creating a new branch based on master then merge back to it.