Article Directory
One, download and configure git
1. git-win-x64 click download and install it directly (it is recommended to copy the link and download it with a downloader such as Thunder, the browser is too slow, remember the installation location).
2. Configure git environment variables:
right click this computer (my computer) -> advanced system settings -> environment variables -> find and edit the path under system variables -> add the installed git path X:\xx\Git\cmd:
3. The first run of git should be executed in cmd (because the git environment is configured and it is a global setting, it is the same in which directory it is executed):
git config --global user.name "your username"
git config --global user.email "your mailbox"
Two, vscode configuration and use git
1. Open vscode, press the shortcut key Ctrl+, (or as shown in the figure) to open the settings
2. Search git.path, click edit
3. Add“git.path”: “G:\92git\Git\cmd\git.exe”, The specific path depends on your installation location
4. Create a new warehouse on git and copy the warehouse address.
5. Enter cmd in the directory bar of a local directory and press Enter (where you want to put the warehouse),
executegit clone https://git.oschina.net/name/test3.git// address of your warehouse,
so your new empty warehouse was cloned into your current directory, and find .git points into a hidden folder, indicating this folder is not an ordinary folder, is a local git repository of
6, After creating a file or pasting a new file in this folder (local git), for example, I create a new file test3.txt with the content test. Open this folder in vscode (or drag the folder to vscode), you can pull, commit, push and other operations!
Common commands are here, click √ (commit) and then push (you will be asked to enter the user name and password for the first time) to push the new file to the git remote warehouse
Three, remember the password
Execute in cmd git config --global credential.helper store Then restart vscode (because the git environment is configured and it is a global setting, the execution in which directory is the same).