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
Open
.Click Marketplace.
In the Search plugins in marketplace field, type
git
and press Enter.Click Install for Git Integration.
Click Install for GitHub.
Restart DataGrip.
Step 2. Log in to your GitHub account
In settings Ctrl+Alt+S, navigate to
.Click Add account Alt+Insert.
In Login and Password fields, enter your GitHub credentials.
Click Log in.
Step 3. Enable Version Control Integration
Navigate to
.In the Enable Version Control Integration dialog, select Git from the list.
Click OK.
Step 4. Clone a GitHub repository
For example purposes, we are going to use the dumps repository: https://github.com/DataGrip/dumps.
Navigate to
.In the URL field, paste
https://github.com/DataGrip/dumps
.In the Directory field, specify a storage path for dumps files .
Click Clone.
In the Checkout From Version Control notification window, click No. If you click Yes, DataGrip suggests creating a new project with cloned files.
Step 5. Attach a directory with cloned files
Right-click in the area of the Files tool window ( ) and select Attach Directory To Project.
In the file browser, navigate to the directory with cloned files and click Open.
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.
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).
Click the Add button ().
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 and select the dumps directory.
From the VCS list, select Git.
Click OK.
Sharing a directory on GitHub
Step 1. Install Git Integration and GitHub plugins
Open
.Click Marketplace.
In the Search plugins in marketplace field, type
git
and press Enter.Click Install for Git Integration.
Click Install for GitHub.
Restart DataGrip.
Step 2. Log in to your GitHub account
In settings Ctrl+Alt+S, navigate to
.Click Add account Alt+Insert.
In Login and Password fields, enter your GitHub credentials.
Click Log in.
Step 3. Enable Version Control Integration
Navigate to
.In the Enable Version Control Integration dialog, select Git from the list.
Click OK.
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.
Right-click in the area of the Files tool window ( ) and select Attach Directory To Project.
In the file browser, navigate to the directory that you want to attach and click Open.
Step 5. Create a local Git repository
Create a Git repository on our machine that you will link with the remote repository on GitHub.
Navigate to
.In the file browser, navigate to the directory that you want to share (for example, dumps ).
Click Open.
Step 6. Create a GitHub repository
On GitHub, click the plus icon and select New repository.
In the Repository name field, specify a name for your repository (for example, dumps).
(Optional) Specify other repository settings.
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).
Step 7. Link local and remote repositories
In DataGrip, navigate to
.In the Git Remotes dialog, click the Add icon .
In the Define Remote dialog, paste the link to your GitHub repository.
Apply changes.
Step 8. Commit local changes
In the Files tool window ( ), right-click the dumps folder and select .
Select the Unresolved Files checkbox in the files pane.
In the Commit Message field, write a commit message.
Click Commit.
Step 9. Push local changes
In DataGrip, navigate to
.In the Push Commits dialog, click Push.