railway service source connect and disconnect existing service sources
Introduced 2026-06-04 · score 0.98
HOW TO USE IT
When you need to change an existing service’s source, use `railway service source connect` with either a GitHub repo or Docker image, or use `railway service source disconnect` to remove its current source.
railway service source connect --repo <owner>/<repo> --branch <branch> --service <service>railway service source connect --image <image> --service <service>railway service source disconnect --service <service>WHY THIS HELPS
Connect or disconnect an existing Railway service to a GitHub repository or Docker image from the CLI.
REQUIREMENTS AND LIMITATIONS
- Version: v4.67.0
- --service <SERVICE> / -s (required): Service name or ID.
- --repo <REPO> (required): GitHub repository in `owner/repo` format; pass this or `--image`, which are mutually exclusive.
- --image <IMAGE> (required): Docker image to connect; pass this or `--repo`, which are mutually exclusive.
- --branch <BRANCH>: Branch to deploy from when connecting a GitHub repository.
- --environment <ENVIRONMENT> / -e: Environment to use.
- --project <PROJECT_ID> / -p: Project ID to use.
- --json: Output in JSON format.
- The new Docker-image handling applies to the existing-service source connection path.
FIRST-PARTY EVIDENCE
- https://github.com/railwayapp/cli/releases/tag/v4.67.0
- https://github.com/railwayapp/cli/pull/934
- https://docs.railway.com/cli/service
Check the installed version and the source before using it. Entry JSON