Coder Social home page Coder Social logo

git-autocomplete's Introduction

To setup autocomplete:

-----------1st Method: worked for me-------------------

  1. Install Git and bash-completion:
sudo apt-get install git bash-completion

check your git version git --version

  1. To set your name and id
git config --global user.name "your name"
git config --global user.email "[email protected]"
  1. restart your bash (new one)

To Test git autocomplete

try git flow TAB shows the files under bash Or

git chekcout master

this will show:

git: 'chekcout' is not a git command. See 'git --help'.

The most similar command is
        checkout

That's it

--------------------------2nd method :(-----------------------------

To setup autocomplete:

  • Install git sudo apt-get install git
  • Enter the command it terminal
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
  • No matter how you acquired the script, you need to rename the file to start with a period. You can do this in the terminal with this command:
mv git-completion.bash .git-completion.bash

Now that we have the file in your home directory with the correct filename, you need to edit either the .bash_profile or .bashrc file found also in your home directory to use the extension. Let’s use the Nano file editor to make the changes assuming you have a .bash_profile file there.

nano .bash_profile

In the editor window type in this code at the end of the file:

if [ -f ~/.git-completion.bash ]; then
   source ~/.git-completion.bash
fi

Apply the changes

The script will work for all new terminal tabs (or windows), to have it running right away you need to execute it:

source ~/.bash_profile

save it & exit

To Test git autocomplete

In new bash try git flow then TAB Or try

git chekcout master

this will show

git: 'chekcout' is not a git command. See 'git --help'.

The most similar command is
        checkout

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.