Home Development Tools VSCode How 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
Copy after login

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"
Copy after login

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  //提交到你的仓库
Copy after login

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输入这个命令就可以了
Copy after login

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     //你的仓库地址
Copy after login

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 of this Website
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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to define header files for vscode How to define header files for vscode Apr 15, 2025 pm 09:09 PM

How to define header files using Visual Studio Code? Create a header file and declare symbols in the header file using the .h or .hpp suffix name (such as classes, functions, variables) Compile the program using the #include directive to include the header file in the source file. The header file will be included and the declared symbols are available.

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

How to solve the problem of vscode Chinese annotations becoming question marks How to solve the problem of vscode Chinese annotations becoming question marks Apr 15, 2025 pm 11:36 PM

How to solve the problem that Chinese comments in Visual Studio Code become question marks: Check the file encoding and make sure it is "UTF-8 without BOM". Change the font to a font that supports Chinese characters, such as "Song Style" or "Microsoft Yahei". Reinstall the font. Enable Unicode support. Upgrade VSCode, restart the computer, and recreate the source file.

Common commands for vscode terminal Common commands for vscode terminal Apr 15, 2025 pm 10:06 PM

Common commands for VS Code terminals include: Clear the terminal screen (clear), list the current directory file (ls), change the current working directory (cd), print the current working directory path (pwd), create a new directory (mkdir), delete empty directory (rmdir), create a new file (touch) delete a file or directory (rm), copy a file or directory (cp), move or rename a file or directory (mv) display file content (cat) view file content and scroll (less) view file content only scroll down (more) display the first few lines of the file (head)

vscode terminal usage tutorial vscode terminal usage tutorial Apr 15, 2025 pm 10:09 PM

vscode built-in terminal is a development tool that allows running commands and scripts within the editor to simplify the development process. How to use vscode terminal: Open the terminal with the shortcut key (Ctrl/Cmd). Enter a command or run the script. Use hotkeys (such as Ctrl L to clear the terminal). Change the working directory (such as the cd command). Advanced features include debug mode, automatic code snippet completion, and interactive command history.

How to use VSCode How to use VSCode Apr 15, 2025 pm 11:21 PM

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages ​​and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

Where to write code in vscode Where to write code in vscode Apr 15, 2025 pm 09:54 PM

Writing code in Visual Studio Code (VSCode) is simple and easy to use. Just install VSCode, create a project, select a language, create a file, write code, save and run it. The advantages of VSCode include cross-platform, free and open source, powerful features, rich extensions, and lightweight and fast.

vscode terminal command cannot be used vscode terminal command cannot be used Apr 15, 2025 pm 10:03 PM

Causes and solutions for the VS Code terminal commands not available: The necessary tools are not installed (Windows: WSL; macOS: Xcode command line tools) Path configuration is wrong (add executable files to PATH environment variables) Permission issues (run VS Code as administrator) Firewall or proxy restrictions (check settings, unrestrictions) Terminal settings are incorrect (enable use of external terminals) VS Code installation is corrupt (reinstall or update) Terminal configuration is incompatible (try different terminal types or commands) Specific environment variables are missing (set necessary environment variables)

See all articles