1. Auto-Completion
After installing git on a linux machine, commands cannot be automatically completed by default. For bash users, implementing git command completion is very simple:
1) download git source code, cd to the contrib/completion directory, find the git-completion.bash File
2) copy the above files to the home Directory of a person, which can be set to a hidden file to avoid accidental deletion:
Cp./git-completion.bash ~ /. Git-completion.bash
After completing the preceding two steps, when you enter the git command, you can press the tab key twice to automatically complete the command.
2. Git Aliases
Setting aliases for common git commands saves the trouble of inputting long-string commands each time. In git, you can use the git config command to conveniently set alias. For example:
Shell> git config -- global alias. co checkout
Shell> git config -- global alias.br branch
Shell> git config -- global alias. ci commit
Shell> git config -- global alias. st status
Shell> git config -- global alias. last 'Log-l head'
After running the preceding command, you can ~ /. In the gitconfig file, these aliases are listed in the alias configuration item.
In fact, we can also directly edit ~ /. Gitconfig file to set the alias ^_^
[References]
ProGit-Chapter 2: Git Basic