This gives you the same dialog we saw earlier allowing you to enter a URL and project directory.
If we already have a project like this one open, we can choose to get a new project from GitHub using the VCS menu and selecting Get from Version Control… in version 2020.2, or Clone in version 2020.3. There’s more than one way to clone a GitHub project from inside IntelliJ IDEA. You an see the result in the Project window. IntelliJ IDEA will also detect the modules in the project, and correctly set up the test, main and resources folders in a Maven project like the one in the video.
IntelliJ IDEA will also pick up common build tools like Gradle or Maven, and automatically download the required dependencies before building the project for you. You can then press Enter, or click Clone, and IntelliJ IDEA will clone the GitHub repository to the directory we selected. You can also change the directory that this project is created in on your machine if required. You can paste the repository URL into the URL input box that we copied from the repository earlier. Clicking on this gives us the Get from Version Control dialog. Regardless of your version, you’ll have an option to get a project from version control. The welcome screen varies from version to version, the video uses the welcome screen in IntelliJ IDEA 2020.3. If you don’t have any projects open when you first start IntelliJ IDEA, you’ll see a welcome screen. When we click the clipboard icon, the URL will be copied to our clipboard. Let’s use HTTPS as it can be the simplest option. You can use HTTPS or SSH, amongst other options. There are several ways to clone a Git repository to your local machine. In the video, we used this IntelliJ samples repository, but it could be one of your repositories if you prefer. The first thing we need to do is to clone the git repository to our local machine. Clone a GitHub Repository to Our Local Machine
This provides an easy way for people to skim the content quickly if they prefer reading to watching, and to give the reader/watcher code samples and links to additional information. This blog post covers the same material as the video with some additional tips and tricks.
If git operations work there, then with the above steps in place, they'll work in IntelliJ.In this blog, we’re going to look at how to create an IntelliJ IDEA project from existing code in a GitHub repository.
Keep in mind that, on Windows, ssh in IDEA uses the environment available in a standard Windows command-line console (cmd.exe). Set your IDEA SSH Configuration as #5 above Start the OpenSSH agent in Task Manager | Services (or any number of other ways) Make sure no other ssh implementation is ahead of this in the path!
In Control Panel | User Accounts | Change my environment variables add C:\Windows\System32\OpenSSH to your path. Then, make a small change and test Commit and push. In IDEA in Settings | SSH Configurations | Authentication type: set it to Key pair OpenSSH or PuTTY and test your connection. In a Windows cmd.exe console, run start-ssh-agent.cmd to start the agent Unset environment variable HOME - it still breaks ssh in this version of IDEA. In Control Panel | User Accounts | Change my environment variables add the Git usr\bin folder to the path after the cmd folder entry already there (e.g. I put it in C:\Git since, as a standard user without an elevated install, I couldn't write to C:\Program Files. Many such failures are possible given the many ssh implementations out there, so know that you know where things are running from. Additional options for complex configurations, such as multiple keys to the same or multiple hosts, can be found in Maddes comprehensive answer on superuser.ĪNY inconsistency between ssh-agent and ssh-add leads to a situation where some things work and some don't.įor example, I had the Windows OpenSSH agent running but my path pointed first to the Git for Windows ssh-add. The bug in Sahil's answer has been fixed and Christian's solution is not needed with the correct entry in your ssh config file for the most common case of one key for one or more hosts.