This version of the EB CLI and its documentation have been replaced with version 3. Version 3 has different commands and is not backwards compatible with version 2. For information on the new version, see The Elastic Beanstalk Command Line Interface (EB CLI).
Maps a Git branch to a new or existing Elastic Beanstalk environment and configures the mapped
environment through a series of prompts. You must first create the Git branch. If no
branches exist in the Git repository, eb displays a message that prompts you to run the
branch command. Eb then attempts to start the application specified in the
default settings in the optionsettings file.
To map a Git branch, first run
, specifying the name of the Git branch you
want to map. Then run
eb branch. If the branch has never been mapped to an
Elastic Beanstalk environment, you'll have the option to copy the most current environment settings to
the new environment.
Consider the following additional information about using
If you run
eb initon an existing repository and change the application name, region, or solution stack, the command resets all existing branch mappings. Run
branchagain to map each branch to an environment.
You can map different Git branches to the same Elastic Beanstalk environment but in most cases maintain one-to-one relationships between branches and environments.
For a tutorial that describes how to use eb to deploy a Git branch to Elastic Beanstalk, see Deploying a Git Branch to a Specific Environment.
The environment to which you want to map the current Git branch. If you do not use this option, you'll be prompted to accept the autogenerated environment name or enter a new one.
For more information, see Eb Common Options.
The following example maps the Git branch
master to a new environment
called MyApp-env-test, using the same settings as a previously created environment called
Myapp-env. Replace the red placeholder text with your own values.
eb branchThe current branch is "master". Enter an AWS Elastic Beanstalk environment name (auto-generated value is "MyApp-master-env"):
MyApp-env-testDo you want to copy the settings from environment "MyApp-env" for the new branch? [y/n]:
eb statusEnvironment "MyApp-env-test" is not running.