Automatic completion setting of Git commands in CentOS 6.4

Source: Internet
Author: User

Git is directly installed with yum in CentOS 6.4, and it is expected that the auto-completion function is not provided. It is really painful for children with poor English skills and poor memory.

Recommended reading:

Fedora downloads Git through Http Proxy

Install Git on Ubuntu Server

Create a Git repository on the server (Ubuntu)

Git simple tutorial in Linux (taking Android as an example)

Git authoritative guide PDF

1. Download the source code, mainly using a bash file that automatically complements the command in the source code.

$ Git clone https://github.com/git/git

The git code is hosted on github.com and can be directly cloned. If you are too lazy to clone the file, I have extracted the automatically completed file and can download it directly at the address below.

Git-completion.bash.zip

Free in http://linux.bkjia.com/

The username and password are both www.bkjia.com

The specific download directory is in the/June/10th/CentOS 6.4 Git command to automatically complete the settings

For the download method, see

2. copy the files in the source code directory to the/etc/bash_completion.d/directory.

$ Sudo cp contrib/completion/git-completion.bash/etc/bash_completion.d/

3. Load the file.

$./Etc/bash_completion.d/git-completion.bash

Pay attention to the previous point. After the command is executed, check whether the git command can be automatically completed.

Tips: If you want to enable automatic loading at system startup, You need to modify the/etc/profile file and ~ /. Add the following script to the bashrc file:

if [ -f /etc/bash_completion .d /git-completion . bash ]; then . /etc/bash_completion .d /git-completion . bash fi

Summary

In the above process, the git version is 1.7.1, and the source code version is the latest downloaded from the official website. The two versions are inconsistent. However, because the function is automatically completed using commands, the relationship should be small. It is better if you can download the source code of the corresponding version.

Git details: click here
Git: click here

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.