CentOS config git command auto-complement

Source: Internet
Author: User
Tags centos git clone

After installing Git in the CentOS system, it is found that there is no command automatic completion function, and the Ubuntu system has this function by default, the following is implemented so that CentOS also supports GIT's command automatic completion function.

1 download git source, CD to Contrib/completion directory, find Git-completion.bash file

2 Copy the above file to the personal home directory, can be set to hide the file to avoid subsequent mistakenly deleted

The code is as follows Copy Code

# cd/tmp
# git clone https://github.com/git/git
# CD git/contrib/completion/
# CP Git-completion.bash ~/.git-completion.bash
3) Edit ~/.BASHRC, add source ~/.git-completion.bash

# VI ~/.BASHRC

Add the following at the end of the file
SOURCE ~/.git-completion.bash
After completing the above steps, restart the shell, and then enter the GIT command in the future, you will be able to use the TAB key to automatically complete the command

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.