Simplify git commands and become an excellent version manager

For R&D or testing, git is an important tool for project version management.
But in normal times, we use git commands to view branches, merge commits and other operations. Although most of the commands are not very long, I believe that after the simplification is completed, the work efficiency will definitely be improved.

.gitconfigEdit directly through the global config file

In Linux, .gitconfigfiles are generally under the root directory.
image.png
Simplified commands can be added directly in the alias, the format is <简化后的命令> = <被简化的命令>
For example, we modify the status to st, save the .gitconfig and use it directly under the project to git stview
image.png

Submit Simplified Commands via Command

git config --global alias.<简化后的命令> <需简化的原命令>
例如:
git config --global alias.st status

Reference

https://blog.csdn.net/thirteen_king13/article/details/118220296

Guess you like

Origin blog.csdn.net/xiaokai1999/article/details/130666134