Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configuration of automatic completion function of Git command

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 270

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report