VSCode configuration Git method steps

VSCode configuration Git method steps

Git is integrated in vscode, and many operations can be performed with just a click, without having to write some git commands.

But this requires you to configure vscode. Next I will talk about git configuration and password-free uploading to github.

1. Install the Git management tool. You can install it on the official website. The installation path is https://git-scm.com/. The default installation path is C:\Program Files\Git. You can modify it yourself. Here I installed it in D:\Program Files\Git.

2. After installing Git, configure the environment variable path information as shown in the figure. It will usually be automatically configured successfully. After the configuration is completed, you can use Git on your computer.


3. To use Git in VS Code, you need to configure git.path in the editor

Configuration steps: In the editor's file->preferences->settings->search for git.path->click edit->find the installation directory of git on your computer, find the bin folder inside, and copy the full path of the git.exe file inside


4. Use of Git in VSCode and password-free upload of Github

First, set the global variables. The following command can be entered directly in the git-bash terminal. After success, a .gitconfig configuration file will be generated under your computer user directory, which contains your username and password.

Git global settings:

git config --global user.name "username" 
git config --global user.email "User mailbox"

Here, I set the terminal to git-bash terminal for convenience. The following is the tutorial

Or search for the following fields in the default user settings

terminal.integrated.shell.windows

Then copy the bash.exe file directory in the bin folder under the installation directory and update it to the user settings as shown in the figure


After setting, you can use the shortcut key Ctrl+~ to open the terminal

The next step is to upload the code to GitHub

Before uploading, create a library on GitHub, that is, the file library of the project as shown in the figure



After the creation is complete, enter vscode, open the terminal and enter the root directory of the project to be uploaded

Then execute the git initialization warehouse command git init

Execute the command git add . to add a file directory to the git repository (the decimal point adds all files in the current directory or only specific files or folders)

Execute the command git commit -m "writable comment content" to upload to the git repository

Execute the command to connect the git repository to the github repository git remote add origin https://github.com/你的github的用戶名/test.git (here is the name of the repository you created plus .git)

Execute the command git push -u origin master to push to the branch (master) (the branch name master is the main branch)

When you click Push for the first time or execute the previous push command, a GitHub login box will pop up. Enter your username and password (you must enter your username and password every time you push in vscode. You can execute the git command here to let the git software remember your password) as follows

git config --global credential.helper store

After executing here, you can go to GitHub to view the newly created GitHub repository. Click it and your project will be there. Success

Because vscode integrates git, some buttons of vscode can replace the git commands entered above, as shown in the figure:

The following figure is recommended for use when you update the code. For the first time, I recommend using git commands throughout the process.


The steps to download the code from GitHub to your computer are as follows:

Since I have integrated the git-bash terminal on vscode before, you can directly open the editor here, open the folder you want to store, press ctrl+~ to open the terminal, and enter the command directly

git clone http://github.com/username/the name of the project you want to clone on github

Wait for the download to complete and the code will be on your computer.

If there is no integrated terminal, open the git-bash terminal, enter the command to enter the address you want to store (cd folder name), and then execute the above clone command again.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to install the git plugin in Visual Studio
  • vscode installation git and project development process
  • VS Code uses Git to visually manage source code in a detailed tutorial (recommended)
  • Detailed explanation of how Visual Studio uses Git to ignore files that you don't want to upload to the remote repository
  • Detailed explanation of the simple use of Git in Visual Studio
  • Detailed explanation of the pitfalls encountered when using git with vscode
  • How to use VSCode to pull projects from GitHub
  • Summary of Git source code management implementation in VS2019
  • Implementation of source code management using Git in VS2017
  • Example of adding GIT and SVN to vscode
  • Tutorial on using Git in vscode
  • How to use git to connect to github via ssh in vscode
  • Visual Studio Code (vscode) git usage tutorial
  • Visual Studio Code uses Git for version control (graphic tutorial)
  • Add Git components to Visual Studio 2019

<<:  Detailed explanation of node.js installation and HbuilderX configuration

>>:  win10 mysql 5.6.35 winx64 free installation version configuration tutorial

Recommend

Unbind SSH key pairs from one or more Linux instances

DetachKeyPair Unbind SSH key pairs from one or mo...

Detailed steps to install MySQL 5.7 via YUM on CentOS7

1. Go to the location where you want to store the...

Teach you how to build the vue3.0 project architecture step by step

Table of contents Preface: 1. Create a project wi...

MySQL 5.7.24 installation and configuration method graphic tutorial

MySQL is the most popular relational database man...

Understanding the Lazy Loading Attribute Pattern in JavaScript

Traditionally, developers create properties in Ja...

MySQL 8.0.12 decompression version installation tutorial

This article shares the installation tutorial of ...

How to change mysql password under Centos

1. Modify MySQL login settings: # vim /etc/my.cnf...

Example analysis of the page splitting principle of MySQL clustered index

This article uses an example to illustrate the pa...

How to reset Zabbix password (one-step)

Problem Description Since we don't log in to ...

Detailed installation and use tutorial of mysql 8.0.15 under windows

This article shares with you the detailed install...

Solution to slow response of Tomcat server

1. Analytical thinking 1. Eliminate the machine&#...

Ant designing vue table to achieve a complete example of scalable columns

Perfect solution to the scalable column problem o...

Introduction to the use of http-equiv attribute in meta tag

meta is an auxiliary tag in the head area of ​​htm...