Jim Lynch Codes
  • Blog
  • About Jim

Writings about one coder's stories & experiences.

Git Bash-Completion: Easy & Awesome

9/1/2019

0 Comments

 
At a new job my coworkers flamed me for not having git bash-completion in my terminal (Lol, really though). Well, they could have asked me in a nicer way hehe, but I shall still be thanking them for helping me to make my command line even more awesome! By the way, I added git bash-completion as a step in my ultimate pretty command line guide which you should definitely check out if you haven't already, but this post is specifically about git bash-completion and why you should use it, and I hope by the end of it you have git bash-completion installed in your terminal too! 😉

Why?

Especially when you work on a team that likes to user super long git branch names **cough cough**, but even when you don't it gets pretty annoying typing out your branch names every time and not getting any auto-completion help the way you do with linux commands like "cd". Well, actually that is a thing, it's called "git bash-completion", and it's actually pretty easy to set up! So, you should do get it! 😊
Confession: I have spent years working on the command line typing out branch names without git branch-completion, and sometimes  I shed a few tears at night wishing I could get some of those keystrokes back. Sign. So, don't make that same mistake I did, and if you already then have hten at least don't continue making it! Install git bash-completion today! (I'm not a salesperson for git bash-completion, I swear!)

Install

So before you can use git bash-completion you need to install it- seems like a logical prerequisite, eh? My favorite way to install it is through brew: 
brew install git bash-completion
Just in case this command fails, if you are on linux/window, or maybe you just have something against brew and want to use macports, there is a great first answer on this stack overflow question that should get you going in the right direction.   

Add To .bash_profile

Edit your "~/.bash_profile" file (or create it if you don't have one) and add this single line to get git bash-completion going:
source /usr/local/git/contrib/completion/git-completion.bash
That's it, and now you should have git bash-completion! Remember that you'll need to run "source ~/.bash_profile" or just boot up a new terminal window to see the changes to your .bash_profile reflected!

Go Crazy!

Now that you have git bash-completion don't forget to use it all the time and wow all your friends who don't yet know about it!
HD video version (for your viewing pleasures)
Gif version (for practical purposes)
Picture
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    ​Author

    Picture
    The posts on this site are written and maintained by Jim Lynch. About Jim...
    Follow @JimLynchCodes
    Follow @JimLynchCodes

    Want FREE access to
    my daily stock tips 
    ​newsletters??
    Sign up here:

    - Triple Gainers
    - Rippers N' Dippers
    - Growingest Growers
    ​

    Categories

    All
    Actionscript 3
    Angular
    AngularJS
    Automated Testing
    AWS Lambda
    Behavior Driven Development
    Blogging
    Business Building
    C#
    C / C++
    ClojureScript / Clojure
    Coding
    Community Service
    CS Philosophy
    Css / Scss
    Dev Ops
    Firebase
    Fitness
    Flash
    Front End
    Functional Programming
    Git
    Go Lang
    Haskell
    Illustrations
    Java
    Javascript
    Lean
    Life
    Linux
    Logic Pro
    Music
    Node.js
    Planning
    Productivity
    Professionalism
    Python
    React
    Redux / Ngrx
    Refactoring
    Reusable Components
    Rust
    Security
    Serverless
    Shell Scripting
    Swift
    Test Driven Development
    Things
    TypeScript
    Useful Sites
    Useful Tools
    Video
    Website Development
    WebStorm
    Writing

    Archives

    February 2021
    January 2021
    October 2020
    September 2020
    May 2020
    April 2020
    February 2020
    January 2020
    December 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    May 2017
    April 2017
    March 2017
    February 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015

    RSS Feed

  • Blog
  • About Jim
JimLynchCodes © 2021