I have a bitbucket project in which many team members are working with. Each team members create separate feature branch for the new feature development and when he is done up he commits the code to the feature branch...upon committing a jenkins job will run for quality testing, further he creates a pull request. The admin user after checking the code will later merge the code to the master for production deployment.
The above process is working fine but would like to know what are other best ways in which we can manage and maintain the repos suitable for production, staging, testing and development environments. I have a idea in my mind which is like creating three sub branches from the main master branch like staging, development, testing. Now the development team will create feature branches from development sub branch and they works and pushes the changes onto it. Later the changes will be merged to development sub branch and deploys in dev environment, further merges to testing sub branch and deploys in test environment, further merges to staging sub branch and deploys in staging environment, after testing merges to main master branch and deploys in production environment.
Can anyone suggest me a best approach better the above for source code management for production, staging, testing and development environments