search
HomeDevelopment ToolsVSCodeHow to use vscode git

How to use vscode git

Nov 18, 2019 am 09:30 AM
vscode

How to use vscode git

How to use vscode git?

vscode introduction

VSCode is a lightweight editor launched by Microsoft. It adopts the same UI interface as VS and can be optimized with appropriate plug-ins. Front-end development experience.

Layout: The left side is the file manager used to display all the files and folders to be edited, followed by the resource manager, search, GIT, debugging, and plug-ins. The right side is the editing area for opening files. Up to three editing areas can be opened to the side at the same time. When using it for the first time, if git is not installed locally, you will be prompted to install git first, and then restart vscode.

git download address

https://git-scm.com/download/win

If the installation process prompts that the environment variable cannot be added to the path, you need to add the cmd directory in the git installation directory to the system path variable

Configure git

Set global configuration

git config --global user.name "your name" 
git config --global user.email "your email"

Enter your project directory

cd d:/wamp/www/wap              //首先指定到你的项目目录下
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/youtname/vscode.git   
//用你仓库的url,vscode.git中vscode为仓库名称,使用时必须先创建
git push -u origin master  //提交到你的仓库

Formal use

Submit code to git

Back Go to vs code and open the git workspace and you will see all the codes displayed here

How to use vscode git

Click the number to submit all files to the staging area.

Then open the menu and select--Submit the temporarily stored

How to use vscode git

Then follow the prompts to enter a message in the message box, and then press ctrl enter to submit

How to use vscode git

Then push all the temporarily stored codes to the cloud.

How to use vscode git

After clicking, a pop-up will pop up asking you to enter your account password. Just enter the account and password of your hosting platform.

If there is no problem, your entire project will be submitted to the cloud.

Every time you update the code in vs, you will need to enter the account password. For convenience, you can configure it to let GIT remember the password account.

git config --global credential.helper store   //在Git Bash输入这个命令就可以了

Synchronization code

Here we talk about how to modify the code and submit it to the cloud, and synchronize the local code with the cloud

Open a file and add a comment

How to use vscode git

You can see a prompt on the git icon. When you open the git workspace, you can see the modified file

How to use vscode git

Then Click the number on the right to temporarily save it.

Enter the message in the message box and press ctrl enter to submit the temporary save

How to use vscode git

Then click push to submit, and the code will be submitted to the cloud.

How to use vscode git

You can see it by opening the code cloud. .

Update back to local

For example, when you modify the code at home and submit it to the cloud, when you return to the company, you only need to open the project with vscode and click pull in the menu to synchronize it.

Clone project

Open Git Bash and enter the following command

cd d:/project   //指定存放的目录
git clone https://github.com/youtname/your repository.git     //你的仓库地址

The above is the detailed content of How to use vscode git. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to format json with vscodeHow to format json with vscodeApr 16, 2025 am 07:54 AM

The ways to format JSON in VS Code are: 1. Use shortcut keys (Windows/Linux: Ctrl Shift I; macOS: Cmd Shift I); 2. Go through the menu ("Edit" > "Format Document"); 3. Install JSON formatter extensions (such as Prettier); 4. Format manually (use shortcut keys to indent/extract blocks or add braces and semicolons); 5. Use external tools (such as JSONLint and JSON Formatter).

How to compile vscodeHow to compile vscodeApr 16, 2025 am 07:51 AM

Compiling code in VSCode is divided into 5 steps: Install the C extension; create the "main.cpp" file in the project folder; configure the compiler (such as MinGW); compile the code with the shortcut key ("Ctrl Shift B") or the "Build" button; run the compiled program with the shortcut key ("F5") or the "Run" button.

How to install vscodeHow to install vscodeApr 16, 2025 am 07:48 AM

To install Visual Studio Code, please follow the following steps: Visit the official website https://code.visualstudio.com/; download the installer according to the operating system; run the installer; accept the license agreement and select the installation path; VSCode will start automatically after the installation is completed.

How to enlarge fonts with vscodeHow to enlarge fonts with vscodeApr 16, 2025 am 07:45 AM

The methods to enlarge fonts in Visual Studio Code are: open the settings panel (Ctrl, or Cmd,). Search and adjust "Font Size". Choose "Font Family" with the right size. Install or select a theme that provides the right size. Use keyboard shortcuts (Ctrl or Cmd) to enlarge the font.

How to connect to a remote server with vscodeHow to connect to a remote server with vscodeApr 16, 2025 am 07:42 AM

How to connect to a remote server through VSCode? Install Remote - SSH Extended Configuration SSH Create a Connection in VSCode Enter connection information: Host, Username, Port, SSH Key Double-click the saved connection in Remote Explorer

How to run vue with vscodeHow to run vue with vscodeApr 16, 2025 am 07:39 AM

Running a Vue project in VSCode requires the following steps: 1. Install the Vue CLI; 2. Create a Vue project; 3. Switch to the project directory; 4. Install project dependencies; 5. Run the development server; 6. Open the browser to visit http://localhost:8080.

How to compare two files with vscodeHow to compare two files with vscodeApr 16, 2025 am 07:36 AM

How to compare files in VSCode: 1. Open two files, 2. Enable the Differences view (View menu), 3. View the Differences (Add green, delete red, modify purple), 4. Use the arrow keys to navigate, 5. Accept or reject changes. Additional features include merging changes, copying changes, viewing details, and editing differences.

How to run js code with vscodeHow to run js code with vscodeApr 16, 2025 am 07:33 AM

How to run JS code in VSCode? Create .js files and write code; install Node.js and npm; install Debugger for Chrome; open the debug console; select Chrome; add debug configuration; set debug scripts; run code; debug code (optional).

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.