Git tutorial
Git git
- Git configuration:
Git config --global user.email "***@qq.com" Git config user.email "***@qq.com"Copy the code
The new project process is as follows:
- After creating the project, run the following command
Git add. // Add all files from the workspace to the staging area git commit -m "first commit" // commit the staging area files to the local repositoryCopy the code
- Create a remote repository (the name of the remote repository must be the same as the name of the local repository) and obtain the address of the remote repository: for example, gitee.com/tuyongtao/v… Then run the following command
Git remote add https://gitee.com/tuyongtao/vuepress-blog.git / / associated with a remote repository git push -u origin master / / push for the first time, the remote repository is empty, so add the -uCopy the code
- The first time you connect to GitHub using Git’s Clone or push command, you get a warning:
The authenticity of host 'github.com (xx.xx.xx.xx)' can't be established. RSA key fingerprint is xx.xx.xx.xx.xx. Are you sure you want to continue connecting (yes/no)?Copy the code
This is because Git uses SSH connections, and SSH connections require you to confirm whether the fingerprint information of GitHub’s Key is really from GitHub’s server. Enter yes and press Enter.
The cloning project flow is as follows
git clone https://gitee.com/tuyongtao/vuepress-blog.git
Copy the code