# Adding GitHub organization to GitProtect

## Using OAuth

{% stepper %}
{% step %}
Log in to **GitProtect Management Service**, open the **DevOps** tab on the left side of the window, and select **GitHub** from the list.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fa7MqaUS62GXpPu5C0qRb%2Fimage.png?alt=media&#x26;token=ccdaa83e-2e66-44c0-842c-2b835ec20b36" alt="" width="227"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click the **Connect** button under **GitHub**.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-40d4b44299c9716bc30cc0e2f0887a4cbf733efb%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
[In the window that pops-up](#additional-browser-permissions), log in with a user account which has the required permissions for the repositories or projects to protect. If your **GitHub** login session is active in a different tab, the login will complete automatically.
{% endstep %}

{% step %}
Grant **GitProtect** access to the specified resources (when prompted).
{% endstep %}

{% step %}
Your **GitHub** organization has now been successfully added to **GitProtect**. Click **Customize policy** to adjust your backup policy settings, or click **Run now** to execute the backup immediately using the current policy configuration.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-453ee231df936230937f13d69ead9e076f74baa6%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

***

## Using GitHub App

{% stepper %}
{% step %}
Log in to **GitProtect Management Service**, open the **DevOps** tab on the left side of the window, and select **GitHub** from the list.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fa7MqaUS62GXpPu5C0qRb%2Fimage.png?alt=media&#x26;token=ccdaa83e-2e66-44c0-842c-2b835ec20b36" alt="" width="227"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click the **advanced mode** link under **GitHub** and **GitHub Enterprise Server** tiles.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-bcb0c971a7a504bf344664d571a2f263820bd371%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Set your authentication method.

1. In **Authentication**, select **GitHub**.
2. For **Connect using**, choose **GitHub App**.
3. Choose whether **GitProtect** should automatically add new repositories to your backup.
   {% endstep %}

{% step %}
Configure your repository sync and default worker. Specify hours for synchronization, or set a time interval for automatic updates.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-5ab58a4516d8c4e632f19414df90102f4b3256ba%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click **Proceed** to complete adding your **GitHub** organization and grant **GitProtect** access to the specified resources. [In the window that pops-up](#additional-browser-permissions), log in with a user account which has the required permissions for the repositories or projects to protect. If your **GitHub** login session is active in a different tab, the login will complete automatically.
{% endstep %}

{% step %}
Select repositories you want to protect and click **Install & Authorize** to proceed.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-788bbb18be333bdb9eb0dbeaf1bf61e24566c6fa%2Fimage.png?alt=media" alt="" width="400"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Your **GitHub** organization has now been successfully added to **GitProtect**. Click **Customize policy** to adjust your backup policy settings, or click **Run now** to execute the backup immediately using the current policy configuration.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-913f60578252996b10f397c9187fb41e242afdf0%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

***

## Using Personal Access Token (PAT)

{% stepper %}
{% step %}
Log in to **GitProtect Management Service**, open the **DevOps** tab on the left side of the window, and select **GitHub** from the list.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fa7MqaUS62GXpPu5C0qRb%2Fimage.png?alt=media&#x26;token=ccdaa83e-2e66-44c0-842c-2b835ec20b36" alt="" width="227"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click the **advanced mode** link under **GitHub** and **GitHub Enterprise Server** tiles.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-438498c51af4f30a5ecf4fcc1bb568717aeeb509%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Set your authentication method.

1. In **Authentication**, select **GitHub**.
2. For **Connect using**, choose **Login and Personal Access Token**.
3. Enter your **username**.
4. Add or select **PAT** from the **Password Manager**.
5. Choose whether **GitProtect** should automatically add new repositories to your backup.

{% hint style="warning" %}
If the **PAT** does not exist, you need to add it. The **PAT** should be pasted into the password field.
{% endhint %}

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-268f94cd711336ea98ff38ba9a57f4cc004aea62%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Configure your repository sync and default worker. Specify hours for synchronization, or set a time interval for automatic updates.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-5ab58a4516d8c4e632f19414df90102f4b3256ba%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click **Proceed** to complete adding your **GitHub** organization and grant **GitProtect** access to the specified resources.
{% endstep %}
{% endstepper %}

***

## Additional browser permissions

When adding an organization, you may be prompted to grant additional permissions to the **GitProtect** application—make sure your browser allows **GitProtect** to open pop-up windows.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-c58cd6d726e43d47a8a4031beb8052c9a7081f35%2F1%20(4).PNG?alt=media" alt=""><figcaption></figcaption></figure>

Depending on your browser, you can either adjust the settings to allow pop-ups or permit the authorization window to open once.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2FH587HP4uqmumoshAJKZh%2Fimage.png?alt=media&#x26;token=fbbdb1b9-02a3-4d7c-934d-81dfdd77baf0" alt="Mozilla pop-up allowance"><figcaption></figcaption></figure>
