1. Install Git

2. Log in to Github and Create a new repository

3. Go to the project directory, right-click Git bash here, and enter Git init to make the current directory a local repository that Git can manage

4. Log in to your git account

 git config  user.name "zhangwenhuiKK" 

 git config  user.email "[email protected]"

5. Add the remote version library named Origin to the local repository

git remote add origin https://github.com/zhangwenhuiKK/xxx.gitCopy the code

6. Pull files from the remote warehouse to the local warehouse

git pull origin master  

7. Submit local files to the remote repository

git push origin master


Common operation

To submit a new file to the warehouse, there are two steps:

Git add readme. TXT to your repository

2. Git commit -m “wrote a readme file

Modify the file and view the changes

If you have modified the file, run the git status command to check the current status of the repository

Use git diff to see the changes

Deleting a Local File

git rm --cached <file>

Deleting a Local Folder

git rm -r  <folder>

To submit the modified file to the repository, there are two steps:

1.git add readme.txt  

2.git commit -m "how you modified the file"

Filter files using.gitignore

In Windows, echo test>. Gitignore creates the. Gitignore file

Edit the content directly with the editor, including the directory do not upload

Git add. (< — don’t ignore this point!) Git automatically uploads files from the current directory other than.gitignore to the local repository

Subsequent to add