In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to use Git in VSCode. I hope you will get something after reading this article. Let's discuss it together.
The most convenient way to use git is, for example, to open vscode at home after the company has written a lot of code, you only need to click pull to synchronize it all. Isn't it convenient. After all, I used to copy it home with a U disk or save it to the cloud disk and download it.
What I use here is the code hosted by the domestic code cloud, and the github can't be understood in English.
Because vscode has git management function, you only need to learn a little about the operation of git.
Download 'msysgit'' on the home page and install it on your computer, otherwise the git in vscode will not work. After the installation is completed, Git Bash is mainly used to operate.
1. Put the code in the code cloud
Build a new warehouse in Ma Yun. When it is finished, Yun will have a command tutorial. Just follow the above.
Tutorials for using in Code Cloud:
-- user.name git config-- user.email-m git push -? git push-u origin master
Here are the detailed local steps:
1. Open your project folder with vs
2. Configure git
Open Git Bash and enter the following command
If you haven't entered the global configuration, enter the global configuration first.
Git global settings: git config-- global user.name "ASxx" git config-- global user.email "123456789@qq.com"
Then start to configure the submission code to Ciyun.
Cd d:/wamp/www/mall360/wap / / first specify git inittouch README.mdgit add README.mdgit commit-m "first commit" under your project directory
Normally, after the above command is executed, there will be a hidden .git folder in the local folder, and there should be a README.md file in your repository in the cloud.
3. Submit the code to the warehouse in vscode
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 and ask 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
4. 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.
Pull usage
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.
5. Clone your project locally
I want to change the code when I get home, but what if the computer doesn't have a file? Look down
First of all, your computer still has vscode and GIT, and then use git to execute the above global configuration again, as follows
Git config global user.name "ASxx" git config-global user.email "123456789@qq.com" git config-global credential.helper store
Then open Git Bash and enter the following command
Cd d:/test / / specify the storage directory git clone https://git.oschina.net/name/test.git / / the address of your warehouse
Download is successful, and then you can use vscode to open the project to modify, and the steps to submit after modification are the same as above: hold-submit-push submit to the cloud and ok.
After reading this article, I believe you have a certain understanding of "how to use Git in VSCode". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.