IntelliJ IDEA downloads GitHub private repository to local (new version)

1. Introduction

This article will introduce how to use the new version IntelliJ IDEA 2020.1to GitHubdownload the private project on the website to the local, and test the submitted code GitHub, and explain the problems that may be encountered.

What is a private project?

A private project is a project that only you and your designated developers can browse or develop. Others without permission cannot browse or know that this project exists in your personal repository. The public project is the project that all GitHubpeople who visit the website can browse and download.

GitHubBefore being acquired by Microsoft, private projects were charged, and you had to pay to use this feature. But now, we can use private projects for free. You can write your own project code, or you may not have complete code for the time being, and you can make it public when it matures. Therefore, the project private or public can be set in the project's settings interface, which is very convenient.

2. Use to IDEAdownload private projects to the local

IntelliJ IDEAThe version in this article is IntelliJ IDEA 2020.1 x64. The new version IDEAsupports one-click download Git, you don't have to download it yourself Git, if you already Githave , then configure it in the settings, and configure the Gitdownload directory by the way.

1. Open IDEAthe git plugin in

insert image description here

2. Copy the GitHubproject address IDEAtoGit

Log in to your GitHub, copy the address of the private repository.
insert image description here
Paste the copied address into the URLtext box and follow the instructions below to set the path.
insert image description here

Notice:

  • If it is just installed for the IDEAfirst time Directory, it will be prompted to download at the bottom of the above picture Git, we can click download.
  • DirectorySet the path, be sure to create a new folder, because IDEAit Gitwill not automatically create a folder for you, it is recommended to use the project name as the folder name.
  • DirectoryWhen setting the path, if you select a folder, it must be an empty folder, otherwise it Gitwill prompt that it is not empty and it is not allowed to download to the local.

3. IDEALogin inGitHub

After clicking clone, IDEAyou will be prompted to log in GitHub, enter GitHubthe account number and password, click Log Inand log in. It is best to tick Rememberit, and you will not need to log in again next time.

insert image description here

4. Successfully downloaded and opened the project

GitHubAfter entering the correct user name and password, you will be prompted to open the project in the current window or a new window (as shown below). If the password is not entered correctly, IDEAthere will be a prompt in the lower right corner, try this step again.
insert image description here

5. Modify the project code and test whether the code can be uploaded to GitHub

We open a file at random, add a line of comment, and then submit it to test whether it can be successfully submitted GitHub.

insert image description here
IDEAThe code analyzer will prompt that the code has warnings, we ignore first, select all Commit and Push, and then select Push.
insert image description here
Refresh GitHubthe page and find that the code is successfully submitted.
insert image description here

Notice:

When submitting the code, IDEAif an error is reported: , at this time, it may be that there is a problem with the user name entered in the column -author 'xxx' is not 'Name ' and matches no existing authorwhen you submit the code . AuthorYou can try to use the following format, input yourname <yourname @qq.com>, replace the name and email with your GitHubaccount, try it yourself, even if you don't use GitHubthe account, you can just enter an author's name.

Summarize:

This article introduces the use of IDEAdownloading and using GitHubprivate repositories. The latest version IDEAand the latest version have GitHubindeed made some changes, but it is indeed more and more convenient for everyone to use. If you like this article, don't forget to like and subscribe.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324206327&siteId=291194637