The GIT command
Git configuration
On the command line, enter the following command:
Git config --global user. Default simple git config --global push config --global core.quotepath false git config --global core.editor "code --wait" git config --global core.autocrlf inputCopy the code
Second, the git init
Git init: creates a. Git directory to hold code blocks
To view this directory, type ls -a into cmder
Third, git add
Git add: Select which changes you want to commit.
Git add. : Commit files in the current directory.
.gitignore: describes which changes do not need to be committed. The common ones are node_modules.ds_store.idea.vscode
You can type git status in the cmder to see which changes are committed and which are not
Four, git commit
Git commit -m string: commit and say why. If the string has Spaces, enclose them in quotes
git commit -v:Help review what was just changed to force a more detailed submission reason(Recommended for beginners)
Enter git log in cmder to view the current commit
Repeat submission
git add.
git commit -v
Repeat these two operations
Git reset –hard XXXXXX
XXXXXX is the first six digits of the commit number. Make sure that all code is committed, as this will cause non-committed changes to disappear
Enter git reflog in cmder to view all commits
Git branch and Git Checkout
Two lines developed at the same time (two blooms)
Git branch: create a branch based on the current commit, and the code will appear at the same branch
Eight, git merge
Git merge: Merge another branch into the current branch (first switch to the branch you want to keep, then merge another branch)
Git branch -d x: Delete unnecessary branches after merge
Conflict resolution: