1. Setting aliases
Cases:
git config--global alias.st status use St instead of status
Later view state git status-> git St can
You can also include parameters
Cases:
git config--global alias.ci "commit-m"
Git commit-m "Balabala", Git ci "balabala" after commit
git config has several parameters that can be used by global or system to make it available to all users
2. Turn on color display
git config--global color.ui true
3.git diff
git diff comparison Workspace vs. staging area files (no difference after git add xx)
Comparison of Git diff head workspace and last commit version (head)
git diff--cached Staging area and head comparison
4.git Checkout
<1>git Checkout Branch switch to branch branch
<2>git Checkout summary showing differences in workspaces, staging area, head
<3>git Checkout HEAD Ibid.
<4>git Checkout--filename to overwrite the filename file of the workspace with the staging area filename file
<5>git Checkout Branch--filename maintain point head, replace the branch and the corresponding file in the workspace with the filename in the submission that staging area points to
<6>git Checkout--. or writing git checkout. (There's a point on the left)
This command is the most dangerous and will cancel all local modifications, relative to the staging area.
Equivalent to overwriting local files with all files of staging area, without giving the user any chance of confirmation
5. File Ignore
Create a file named. Gitignore in the directory (with a dot in front of it) and write the file you want to ignore in one row for each file you want to ignore.
You can add. Gitignore to the repository, or you can ignore yourself (. gitignore files) in ignore
You can see the ignored files with git status--ignored-s
Ignores files that are not tracked and is not valid for files that have been added to the repository.