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

Solve the problem of spring boot + jar packaging deployment tomcat 404 error

1. Spring boot does not support jsp jar package, ...

Nginx builds rtmp live server implementation code

1. Create a new rtmp directory in the nginx sourc...

Tic-Tac-toe game implemented in pure CSS3

Operation effect: html <div class="tic-ta...

Steps to split and compress CSS with webpack and import it with link

Let's take a look at the code file structure ...

A brief discussion on the definition and precautions of H tags

Judging from the results, there is no fixed patte...

Example code for using text-align and margin: 0 auto to center in CSS

Use text-align, margin: 0 auto to center in CSS W...

Several skills you must know when making web pages

1. z-index is invalid in IE6. In CSS, the z-index...

Practical solution for Prometheus container deployment

environment Hostname IP address Serve Prometheus ...

Complete steps to implement face recognition login in Ubuntu

1. Install Howdy: howdy project address sudo add-...

Example of implementing element table row and column dragging

The element ui table does not have a built-in dra...

How to install vim editor in Linux (Ubuntu 18.04)

You can go to the Ubuntu official website to down...

Explore how an LED can get you started with the Linux kernel

Table of contents Preface LED Trigger Start explo...

Use Smart CSS to apply styles based on the user's scroll position

By adding the current scroll offset to the attrib...

JavaScript implements a box that follows the mouse movement

This article shares the specific code of JavaScri...

How to quickly log in to MySQL database without password under Shell

background When we want to log in to the MySQL da...