DataGrip 2019.3 Help

How to start a GitHub project in DataGrip

This tutorial covers two general use cases:

Cloning an existing GitHub repository

Step 1. Install Git Integration and GitHub plugins

  1. Open Settings | Plugins.

  2. Click Marketplace.

  3. In the Search plugins in marketplace field, type git and press Enter.

  4. Click Install for Git Integration.

  5. Click Install for GitHub.

  6. Restart DataGrip.

Install Git Integration and GitHub plugins

Step 2. Log in to your GitHub account

  1. In settings Ctrl+Alt+S, navigate to Version Control | GitHub.

  2. Click Add account Alt+Insert.

  3. In Login and Password fields, enter your GitHub credentials.

  4. Click Log in.

Log in to your GitHub account

Step 3. Enable Version Control Integration

  1. Navigate to VCS | Version Control Integration.

  2. In the Enable Version Control Integration dialog, select Git from the list.

  3. Click OK.

Enable Version Control Integration

Step 4. Clone a GitHub repository

For example purposes, we are going to use the dumps repository: https://github.com/DataGrip/dumps.

  1. Navigate to VCS | Git | Clone.

  2. In the URL field, paste https://github.com/DataGrip/dumps.

  3. In the Directory field, specify a storage path for dumps files .

  4. Click Clone.

  5. In the Checkout From Version Control notification window, click No. If you click Yes, DataGrip suggests you to create a new project with cloned files.

Clone a GitHub repository

Step 5. Attach a directory with cloned files

  1. Right-click in the area of the Files tool window (View | Tool Windows | Files) and select Attach Directory.

  2. In the file browser, navigate to the directory with cloned files and click Open.

Attach a directory with cloned files

Step 6. Register the VCS root directory

DataGrip supports a directory-based versioning model. It means that each project directory can be associated with a different version control system.

  1. Open version control settings (File | Settings | Version Control). This page shows a list of project directories and version control systems associated with them (if no directories have been added, the list only contains the project root).

  2. Click the Add button (the Add button).

  3. In the Add VCS Directory Mapping dialog, select the Directory option. Type the path to the directory that you want to associate with a version control system, or click the Browse button the Browse button and select the dumps directory.

  4. From the VCS list, select Git.

  5. Click OK.

Sharing a directory on GitHub

Step 1. Install Git Integration and GitHub plugins

  1. Open Settings | Plugins.

  2. Click Marketplace.

  3. In the Search plugins in marketplace field, type git and press Enter.

  4. Click Install for Git Integration.

  5. Click Install for GitHub.

  6. Restart DataGrip.

Install Git Integration and GitHub plugins

Step 2. Log in to your GitHub account

  1. In settings Ctrl+Alt+S, navigate to Version Control | GitHub.

  2. Click Add account Alt+Insert.

  3. In Login and Password fields, enter your GitHub credentials.

  4. Click Log in.

Log in to your GitHub account

Step 3. Enable Version Control Integration

  1. Navigate to VCS | Version Control Integration.

  2. In the Enable Version Control Integration dialog, select Git from the list.

  3. Click OK.

Enable Version Control Integration

Step 4. Attach a directory

To share your scripts on GitHub, you need to attach the directory from your computer to the Files tool window.

  1. Right-click in the area of the Files tool window (View | Tool Windows | Files) and select Attach Directory.

  2. In the file browser, navigate to the directory that you want to attach and click Open.

Attach a directory

Step 5. Create a local Git repository

Create a Git repository on our machine that you will link with the remote repository on GitHub.

  1. Navigate to VCS | Import into Version Control | Create Git repository.

  2. In the file browser, navigate to the directory that you want to share (for example, dumps ).

  3. Click Open.

Step 6. Create a GitHub repository

  1. On GitHub, click the plus icon and select New repository.

  2. In the Repository name field, specify a name for your repository (for example, dumps).

  3. (Optional) Specify other repository settings.

  4. Click Create repository.

    As a result, the GitHub repository is created. On the Code tab, you will see a link to your repository (for example, https://github.com/JetBrainsUser/dumps.git).

Create a GitHub repository
  1. In DataGrip, navigate to VCS | Git | Remotes.

  2. In the Git Remotes dialog, click the Add icon the Add icon.

  3. In the Define Remote dialog, paste the link to your GitHub repository.

  4. Apply changes.

Link local and remote repositories

Step 8. Commit local changes

  1. In the Files tool window (View | Tool Windows | Files), right-click the dumps folder and select Git | Commit directory.

  2. Select the Unresolved Files checkbox in the files pane.

  3. In the Commit Message field, write a commit message.

  4. Press Commit.

Commit local changes

Step 9. Push local changes

  1. In DataGrip, navigate to VCS | Git | Push.

  2. In the Push Commits dialog, click Push.

Push local changes
Last modified: 9 December 2019