Get the App
SLTechnology News&Howtos  ›  Development  › 

Configuration of automatic completion function of Git command

Shulou Source: shulou.com Published: 2022-06-03 16:49:58 10月04日 Update

This article mainly explains "the configuration of automatic completion function of Git command". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn the "Git command automatic completion function configuration" bar!

Recently, I want to be lazy, so I have configured the auto-completion function under the git command.

When configuring this feature, you only need to download the git-bash-completion.git file, not all the git source code.

The required files are open source files for github search (thank you very much). The details are as follows:

Step1:

Root@ubuntu:~# git clone https://github.com/markgandolfo/git-bash-completion.gitroot@ubuntu:~# cp git-bash-completion/git-completion.bash ~ / .git-completion.bashroot@ubuntu:~# ll .git-completion.bash-rwxr-xr-x 1 root root 27704 Feb 18 06:16. Git-completion.bash*

Step2:

Modify ~ / .bashrc by adding at the end of the file:

If [- f ~ / .git-completion.bash]; then. ~ / .git-completion.bashfi

Step3:

Execute the .bashrc file, execute the git command in the same window, and use the tab key to complete the subsequent parts of the command.

Root@ubuntu:~# source ~ / .bashrcroot @ ubuntu:~# git stastage stash status

Note:

1. The above is the completion function of git command. Don't be confused with linux command completion. Linux command completes the installation method: apt-get install bash-completion.

2. You can use the git config command to configure git command aliases to reduce command input.

At this point, I believe that everyone on the "Git command automatic completion function configuration" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Commands functions configurations files contents methods learning practical deeper interests aliases practicality practical easy to operate more friends source code websites parts channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL vpn macOS MariaDB