Implementation:CARLA simulator Carla Git Clone Repository
| Knowledge Sources | |
|---|---|
| Domains | Build_System, Development |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete tool for cloning the CARLA simulator source repository from GitHub with the correct branch selected in the CARLA build pipeline.
Description
This implementation uses git clone with the -b flag to acquire the CARLA source code from the official GitHub repository. The command targets the ue5-dev branch and places the working copy into a directory named CarlaUE5. This directory name is used by convention throughout CARLA's build scripts, including CarlaSetup.sh and the documentation in Docs/build_linux_ue5.md.
The clone operation downloads the full Git history for the specified branch, including all source files, build scripts, CMake configurations, and documentation needed for the subsequent build steps.
Usage
Use this command as the first step when setting up a CARLA build-from-source environment on any supported platform (Linux, Windows, macOS). This must be executed before running any prerequisite installation scripts or build commands, as those scripts expect to be run from within the cloned repository directory.
Code Reference
Source Location
- Repository: CARLA
- File:
README.md:L84-88,Docs/build_linux_ue5.md:L14-18
Signature
git clone -b ue5-dev https://github.com/carla-simulator/carla.git CarlaUE5
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
-b ue5-dev |
Branch name | Yes | Specifies the branch to check out after cloning. Must be ue5-dev for UE5-based builds.
|
| Repository URL | URL | Yes | The CARLA GitHub repository URL: https://github.com/carla-simulator/carla.git
|
CarlaUE5 |
Directory name | No | Target directory name for the clone. Defaults to carla if omitted, but CarlaUE5 is the expected convention.
|
Outputs
| Name | Type | Description |
|---|---|---|
CarlaUE5/ |
Directory | Cloned repository with the ue5-dev branch checked out as the active working tree.
|
CarlaUE5/.git/ |
Git metadata | Full Git history and configuration for the repository, enabling future pulls and branch operations. |
| Exit code | Integer | 0 on success; non-zero on failure (network error, permission denied, directory already exists).
|
Usage Examples
Basic Example
# Clone the CARLA repository targeting the ue5-dev branch
git clone -b ue5-dev https://github.com/carla-simulator/carla.git CarlaUE5
# Verify the clone was successful
cd CarlaUE5
git branch --show-current
# Output: ue5-dev
Shallow Clone for Faster Download
# Use --depth 1 for a shallow clone if full history is not needed
git clone -b ue5-dev --depth 1 https://github.com/carla-simulator/carla.git CarlaUE5
Clone via SSH (for Contributors)
# Contributors with SSH keys configured can use the SSH URL
git clone -b ue5-dev git@github.com:carla-simulator/carla.git CarlaUE5