You can make eb cli refer to different environments from different branches by adding config, as shown below, to your .elasticbeanstalk / config.yml file:
branch-defaults: master: environment: staging production: environment: production
In this example, when you run eb deploy from the master branch, it deploys in your environment with the name "staging", whereas when you launch it from the production branch, it deploys in your environment with the name "production".
This approach does not allow the use of a single branch in several environments; see @adnan answer: fooobar.com/questions/987372 / ...
source share