Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

Time:2022-4-26

catalogue

Step 1: install git command line tool

Step 2: configure git in vscode

Step 3: use vscode + git to submit to the warehouse


When we need to submit the code to git warehouse after writing the code in vscode, but we don’t want to switch to git’s command line window, we can configure git in vscode and then submit the code to git warehouse conveniently and quickly.

Step 1: install git command line tool

clickGit official website, and then click download to come to the following interface

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

Select the corresponding version according to your computer. I download it hereWindows 

There are many tutorials for installing git tools on the Internet. They are relatively simple and will not be recorded in detail here.

Note: be sure to remember your installation path!!!

After the installation is completed, right-click on the desktop and the icon shown in the figure below appears, indicating that the installation is successful:

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

Step 2: configure git in vscode

1. Open vscode and click the place in the figure below

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

 2. Enter in the input boxgit.path , and then click the second place to opensettings.json file

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

3. Insettings.json File, addgit Installation path of

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

 

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

Note: the colon is preceded bygit.path , path iscmd In foldergit.exe 

Then closeVScode , open it again. After a few seconds, click the third icon on the left, that is, the first place in the figure below. It is found that the second and third places have become clickable, not dark. The surface git environment configuration is successful.

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

Step 3: useVScode + git, submit to warehouse

First fromGitHub Pull down a warehouse,

If the following errors occur, you can refer to my previous articleBlog, you can solve the problem or climb over the wall

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

Using the previous blog method, successclonecome down

be careful!!! Although this method can be successfulclone However, errors will still be reported in subsequent push commands, so it is recommended to turn over the wall and git clone againGitHub – jin5437 / manage-system-vue2: background management system implemented by vue2 + router

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

After climbing the wall:

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

UseVScode , openclone Here’s the file I foundGitHub A small project published on, usingVue2 + router , the implementation of a small user management system, interested friends canclone Down, suitable for beginners.

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

When we modify the code, we will be prompted on the left which file has changed

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

Click the button at the third place in the figure above+Sign, indicatingadd Command, as shown in the figure below. At this time, the file is placed in the temporary storage area

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

In the input box in the figure below, enter the comments to be submitted, such asagain test , and then, you can pressCtrl + enter , or click the check mark in the orange box to finish commit command

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

Next, click the first place in the figure below, and then click pull and push in turn, that ispull Command andpush Command.

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

After the command is completed,VScode To meGitHub The account has been authenticated and can be operated step by step.

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

 

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

 

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

GoGitHub Check the warehouse on the official website and you will find that it has been successfully pushed!  

Windows + vscode configuration and use git, super detailed tutorial, collect it quickly

 

So far, it’s done!