Managing multiple environments with Ansible can be achieved using the repo script tool. The repo script allows fetching different versions of Ansible roles, playbooks, and other components from separate Git repositories into a single work directory for each environment. A manifest file defines which components to fetch from which repositories and revisions for a given environment. This allows shifting components from lower to higher environments in a controlled manner while keeping the history of individual components in their original Git repositories. The repo script provides commands to manage, sync, and apply changes across all managed components.