> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/use-harness-platform/git-experience/import-a-pipeline.md).

# Import a pipeline from Git

Harness lets you create a Pipeline in the following ways:

* Create an inline Pipeline and save its configuration in Harness.
* Create a remote Pipeline and save its configuration in Git.
* Import a Pipeline from Git and save its configuration in Git.

This topic explains how to import a Pipeline from your Git repo to Harness.

#### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* [Harness Git Experience Overview](/harness-platform/use-harness-platform/git-experience/git-experience-overview.md)
* [Harness Git Experience Quickstart​](/harness-platform/use-harness-platform/git-experience/configure-git-experience-for-harness-entities.md)
* [Manage a Harness Pipeline Repo Using Git Experience](/harness-platform/use-harness-platform/git-experience/manage-a-harness-pipeline-repo-using-git-experience.md)

#### Permissions <a href="#permissions" id="permissions"></a>

* Make sure you have **Create/Edit** permissions for Pipelines.

#### Import pipeline <a href="#import-pipeline" id="import-pipeline"></a>

You can import a Pipeline from the CI or CD module in Harness.

This topic shows you how to import a Pipeline to the CD module.

1. Select your project, then select **Pipelines**.
2. Select **Import From Git**.

   ![](/files/23E2nzQ2B5EHcuchqixh)

   The **Import Pipeline From Git** settings appear.

   ![](/files/zrQVpfWQRHUzSCl04dZ4)
3. Enter a **Name** for your Pipeline.
4. If you are not using Harness Code Repository you will require a git connector. In **Git Connector**, select or create a Git Connector to connect to your Git repo. For steps, go to [Code Repo Connectors](/harness-platform/use-harness-platform/connectors/code-repositories/connect-to-code-repo.md).

<details>

<summary>IMPORTANT: Connector must use the Enable API access option and Token</summary>

The Connector must use the Enable API access option and Username and Token authentication. Harness requires the token for API access. Generate the token in your account on the Git provider and add it to Harness as a Secret. Next, use the token in the credentials for the Git Connector.​

![](/files/YAic7a8wDAmvPc9Mgpxf)

For GitHub, the token must have the following scopes:

![](/files/cxwhYn0HsIyPnOCoEEHS)

</details>

Here's an example of a GitHub Connector that has the correct settings:

​![](/files/YAic7a8wDAmvPc9Mgpxf)

5. In **Repository**, select the repository from where you want to import the pipeline. If your repository isn't listed, enter its name since only a select few repositories are filled here.

{% hint style="info" %}
Create the repository in Git before entering it in **Select Repository**. Harness does not create the repository for you.
{% endhint %}

6. In **Git Branch**, select the branch from where you want to import the pipeline. If your branch isn't listed, enter its name since only a select few branches are filled here.

{% hint style="info" %}
Create the branch in your repository before entering it in **Git Branch**. Harness does not create the branch for you.
{% endhint %}

7. Enter the **YAML Path** from where you want to import the pipeline. All your configurations are stored in Git in the [Harness Folder](/harness-platform/use-harness-platform/git-experience/git-experience-overview.md#harness-folder).

{% hint style="info" %}
Make sure that your YAML path starts with `.harness/` and the YAML file already exists in the specified Git repo and branch.
{% endhint %}

8. Click **Import**.\
   Click on your Pipeline to proceed.\
   By default, Harness fetches your Pipeline details from the default branch. If you have imported Pipeline from some other branch you will see the below error.![](/files/NA3o7GGK9IvEMq5ACrkN) Select the branch from where you imported the Pipeline and continue.

#### See also <a href="#see-also" id="see-also"></a>

* [Manage input sets and triggers in simplified Git Experience​](/harness-platform/use-harness-platform/git-experience/manage-input-sets-in-simplified-git-experience.md)
* [Manage a Harness Pipeline Repo Using Git Experience](/harness-platform/use-harness-platform/git-experience/manage-a-harness-pipeline-repo-using-git-experience.md)
