NEVER COMMIT ON THE SERVER
For version control 372Digital uses Bitbucket.
- Before a Deployment, the DEV branch is used
- During Development the DEV branch is used alongside the STAGING branch
- The MASTER branch is reserved for the live site
Commits Should Be reasonably small only to contain the required code for the single unit of work completed.
To create a new bit bucket repo
- Head over to https://bitbucket.org/dashboard/overview
- Click the plus icon
- Click ‘Repository’
- Enter an appropriate name, see Project File Management
- Check ‘This is a private repository’
- Click ‘Create Repository’
If changes Exist on the Server and don’t exist locally
If something in the server environment changes and there are new/ modified files you may need to test these changes locally.
This could occur due to an automatic update , or somehow the client may have update plugins or WordPress core etc.
To make certain that these changes don’t conflict with our development environment we need to do the following.
- SSH into the server
- Create a new branch [server] if it does not exist
- Checkout to [server]
- Stage all changes to the new branch
- Commit Changes with commit message of ‘ Server Commit’
- Push Commits to Bit Bucket
- On your local machine fetch then pull the new branch
- Checkout to your Working branch DEV
- Merge changes, resolve conflicts and QA these to ensure everything works as expected.
- if these changes do not work as expect roll back, this is why we use version control.