Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of vscode git

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the use of vscode git, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's learn about it!

How do I use vscode git?

Introduction to vscode

VSCode is a lightweight editor released by Microsoft, which uses the same UI interface as VS, and the experience of front-end development can be optimized with appropriate plug-ins.

Layout: on the left is the file manager that shows all the files and folders to be edited, followed by Explorer, search, GIT, debugging, plug-ins, and on the right is the editing area of the open file, up to three editing areas can be opened to the side at the same time. If git is not installed locally for the first time, 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 path, you need to add the cmd directory under the git installation directory to the system's 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 / / first specify git inittouch README.mdgit add README.mdgit commit-m "first commit" git remote add origin https://github.com/youtname/vscode.git / / use the vscode in the url,vscode.git of your warehouse as the warehouse name, and you must first create git push-u origin master / / and submit it to your warehouse.

Formal use

Submit the code to git

Go back to vs code and open the git workspace and you will see all the code displayed here.

Click the + sign to submit all files to the staging area.

Then open the menu and select-- submit the temporarily saved

Then press the prompt to enter a message in the message box, and then press ctrl+enter to submit

Then put all the temporary code on the push cloud

After clicking, it will pop up for you to enter the account password and enter the account password of your hosting platform.

If nothing goes wrong, your entire project will be submitted to the cloud.

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

Git config-- global credential.helper store / / enter this command in Git Bash

Synchronization code

Here we talk about the use of modifying the code and submitting it to the cloud to synchronize with the local code and the cloud.

Open any file and add a comment

You can see that the git icon has a prompt. If you open the git workspace, you can see that this file has been modified.

Then click the + sign on the right to save him temporarily.

Then enter the message in the message box and press ctrl+enter to submit it for temporary storage

Click push to submit again, and the code will be submitted to the cloud.

Open the yard cloud and you can see it.

Update back locally

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 use vscode to open the project and click pull in the menu to synchronize it.

Clone project

Open Git Bash and enter the following command

Cd d:/project / / specify the storage directory git clone https://github.com/youtname/your repository.git / / the address of your warehouse is all the contents of this article "the use of vscode git". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report