> ## Documentation Index
> Fetch the complete documentation index at: https://docs.directenergypartners.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pull Changes

This section explains how to clone your personal `dep-ppl-base` repository from GitHub to the Power Platform controller,
as well as how to pull the latest changes from the remote repository to the controller.

<Note>
  Pulling or cloning is only possible if the controller has internet access to reach GitHub. Ensure the controller is connected to the internet before proceeding.
</Note>

If the controller doesn’t have direct internet access to GitHub, you can instead use the copy method to transfer the `etc` folder from your local `dep-ppl-base` repository to the Power Platform controller.

<Card title="Copy etc Folder" icon="copy" href="/configure/repository/copy" horizontal />

## Clone the Repository

If you have already cloned the repository, you can skip this section and go directly to the [Pull the Latest Changes](#pull-the-latest-changes) section.

<Steps>
  <Step title="Open Terminal">
    Open a terminal on your local machine and connect to the controller using SSH:

    ```bash theme={null}
    ssh admin@<controller_ip>
    ```

    Enter the admin password when prompted.
  </Step>

  <Step title="Navigate to Target Folder">
    ```bash theme={null}
    cd /opt/plcnext/appshome/data/60002172000969
    ```
  </Step>

  <Step title="Initialize Git Repository">
    ```bash theme={null}
    git init
    ```
  </Step>

  <Step title="Add Safe Directory">
    ```bash theme={null}
    git config --global --add safe.directory /opt/plcnext/appshome/data/60002172000969
    ```
  </Step>

  <Step title="Add Remote Repository">
    ```bash theme={null}
    git remote add origin https://github.com/YOUR_USERNAME/dep-ppl-base.git
    ```

    Make sure to replace `YOUR_USERNAME` with your actual GitHub username.
  </Step>

  <Step title="Enable Sparse Checkout">
    Enable sparse-checkout to clone only specific paths:

    ```bash theme={null}
    git sparse-checkout init --cone
    git sparse-checkout set etc
    git pull
    ```
  </Step>

  <Step title="Checkout Main Branch">
    ```bash theme={null}
    git checkout main
    ```
  </Step>

  <Step title="Pull changes">
    Pull the contents from the remote repository:

    ```bash theme={null}
    git pull
    ```
  </Step>
</Steps>

## Pull the Latest Changes

To pull the latest changes from the remote repository on the Power Platform controller, follow these steps:

<Note>
  Ensure the controller has internet access to GitHub. Without connectivity, `git pull` will fail.
</Note>

<Steps>
  <Step title="Open Terminal">
    Open a terminal on your local machine and connect to the controller using SSH:

    ```bash theme={null}
    ssh admin@<controller_ip>
    ```

    Enter the admin password when prompted.
  </Step>

  <Step title="Change Directory">
    Change directory to the location where you cloned the repository.

    ```bash theme={null}
    cd /opt/plcnext/appshome/data/60002172000969
    ```
  </Step>

  <Step title="Pull Changes">
    Run the following command to pull the latest changes from the remote repository:

    ```bash theme={null}
    git pull
    ```
  </Step>
</Steps>
