The most complete installation and use of GitHub Copilot

The most complete installation and usage tutorial of GitHub Copilot

1. Tips

GitHub Copilot is free to try for one month so far, but the premise of the trial is to bind a bank card, because the follow-up will be automatically deducted, so please pay attention to the end date of the trial, and set the alarm clock to close the subscription.

The subscription price is US$10 per month and US$100 per year. Personally, I think it is a bit expensive. You can subscribe if you need it, but please carefully consider whether to subscribe.

2. GitHub Copilot registration

official website: 

https://github.com/features/copilot/ https://github.com/features/copilot/ 1.First, you need to register a github account. If you don’t have an account, you can also use a company shared account. Registering with github will not go into details.

2. If you do not log in to the github account, open the official website address and the following page will be displayed

Click the Start my free trial button in the red box above  to start.

3. If you have logged in to the github account, open the official website address and the following page will be displayed

Click the Get Copilot button in the red box above  to get started.

4. Open the page as shown below and directly click the green button in the red box to enter the next step

5. Fill in personal information, Save  and go to the next step

6. Fill in the payment method,  Save payment information  and go to the next step

7. Or directly log in to the company's shared account without having to go through the three steps of 4 5 6.

3. Install the GitHub Copilot plugin for Visual Studio Code

  1. Open Visual Studio Code.

  2. Click on the Extensions tab on the left.

  3. Search for the "GitHub Copilot" extension.

  4. Click "Install" to install the extension.

Q&A and process

1. When installing GitHub Copilot, an error may appear as shown in the figure below, and no solution has been found yet. If anyone knows, please advise.

There was an error installing the "GitHub Copilot" extension, and manual installation is fine.

Select the downloaded file with the .vsix suffix GitHub.copilot-1.89.156.vsix 

Immediately reload, restart the VS Code software, and the page shown in the figure below appears, indicating that the plug-in is installed successfully

2. Restart VS Code, a prompt as shown in the figure below will appear in the lower right corner, Sign in to GitHub to log in to your github account

If there is no prompt in the above picture, click the gear setting button in the lower left corner, "Log in with GitHub to use GitHub Copilot(1)"

The next step is to click the next step one by one without thinking.

Finally, if the robot icon shown in the figure below appears in the lower right corner, it means that the installation plug-in is installed successfully.

If the robot icon does not appear, or there is a slash on the robot icon, it means that the installation is not successful.

The solution is to log out of the GitHub account, close VS Code and reopen it, log in to the GitHub account again, and repeat step 2 until successful.

4. Usage

1. Write a comment to briefly explain the purpose, then press Enter and wait for a while, at this time the robot icon in the lower right corner will circle

Note: Write comments first, then write code , or vice versa, write code first, then write comments

2. When the gray code prompt appears

Tab can be quickly completed;

Ctrl+Enter will give up to ten suggestions;

Alt+] is next;

Alt+[ is previous;

 

 

Guess you like

Origin blog.csdn.net/GrootBaby/article/details/131229449