---
title: "Migrating a repo to GitHub from the command line"
date: "2024-02-14T06:18:38+00:00"
summary: "Learn how to migrate your Git repository to GitHub using command-line tools. Follow our step-by-step guide to seamlessly transfer your project, including renaming remotes and pushing branches."
image:
type: "page"
url: "/acquia-cloud-platform/migrating-repo-github-command-line"
id: "6309bdeb-ed56-4b6d-bb5f-4b747d8369bf"
---

If you have a Git repository which is cloned from a Cloud Platform repository and you want to use the Cloud Platform Pipelines command-line client to switch to using GitHub as the source repository for the associated application, complete the following steps:

1.  Ensure you have all the latest commits from the Cloud Platform repository by executing the following command:
    
        git fetch
    
2.  Rename the Cloud Platform remote repository from `origin` to your desired new name, such as `cloud`:
    
        git remote rename origin cloud
    
3.  Add a new remote repository named `origin` for the GitHub repository you want to use, replacing `[USER]` and `[REPO]` with the appropriate values:
    
        git remote add origin git@github.com:[USER]/[REPO].git
    
4.  Push all branches from the repository to GitHub:
    
        git push origin --all --force
    
5.  Run the `pipelines github-connect` [command](/acquia-cloud-platform/features/pipelines/cli/commands) to associate this repository with your Cloud Platform application.