Mac git command auto-complete

Source: Internet
Author: User

The steps are as follows:
1, download Git-completion.bash or directly use Sourcetree to clone to local.
: https://github.com/markgandolfo/git-bash-completion

2. From the downloaded Git-bash-completion folder, locate Git-completion.bash and copy the file to ~/(copy this file to your own user home directory) and rename it to. Git-completion.bash (in. The file named at the beginning is a hidden file that can be prevented from being accidentally deleted)

3. If you do not have a. bashrc file in your user home directory (~/), create a new one and add the following to the. bashrc file:

SOURCE ~/.git-completion.bash

Then save the. bashrc file, note that if you want to take effect immediately, you can generally try the following:
(1) Exit the terminal and restart;
(2) if (1) is unsuccessful, you can run the following command at the command line immediately: source ~/.git-completion.bash

4, but after the setup of step 3, there may be a disadvantage, that is, each time you restart the terminal, you need to execute the following command: source ~/.git-completion.bash to take effect.
Improvement: In the. bash_profile file, add the following code.

if  Then ~/.git-completion.bashfi     

Mac git command auto-complete

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.