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
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:
Step 2: configure git in vscode
1. Open vscode and click the place in the figure below
2. Enter in the input boxgit.path , and then click the second place to opensettings.json file
3. Insettings.json File, addgit Installation path of
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.
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
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
After climbing the wall:
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.
When we modify the code, we will be prompted on the left which file has changed
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
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
Next, click the first place in the figure below, and then click pull and push in turn, that ispull Command andpush Command.
After the command is completed,VScode To meGitHub The account has been authenticated and can be operated step by step.
GoGitHub Check the warehouse on the official website and you will find that it has been successfully pushed!
So far, it’s done!