Configure GIt

Git config --global user.email 123445678.com git config --global push.default simple git config --global core.quotepath false git config --global core.editor "code --wait" git config --global core.autocrlf inputCopy the code

Git config –global –list

git init

  • git initCreate a repository where your.git directory holds your code in your current directory.

git add

  • The marked documents have been loaded onto the car, but have not yet been sent to the warehouse.
Git add. // Mark all filesCopy the code
  • .gitignore can be ignored

Common ones are.nede_modules.idea.vscode

git status

  • If you can’t remember what file was marked, use this to look at it, okay

git commit

  • This step is to send the marked file to the warehouse.
Git commit -m "shipping reasons" // short writable reasons git commit -v // recommendedCopy the code

git log

  • git logUsed to view the history of the submission

git reset –hard XXXXXX

  • Version of the jump
  • XXXXXX is the first six digits of the submission number
  • Make sure all code is sent to the repository, because this will make code that doesn’t go to the repository disappear

git reflog

  • git reflogView all commit records (including jumps)

git branch x

  • git branch xTo create a branch

git checkout x

  • git checkout xLet’s switch to the branch
  • git checkout mainSwitch back

Git merge

  • git mergeMerges another branch into the current branch

How can merge conflicts be resolved

  • Found that conflict

When merging branches, you get a conflict prompt

Use git status -sb to check that the file conflicts

  • Resolve the conflict

Find four ==== equals signs

Select the code you want to keep in the upper and lower sections

Delete unused code including (======<<<<>>>>>)

Git add corresponding files

Git status-sb again to resolve the next file conflict

Until there are no conflicts, run git Commit (no option required)