Git Autocomplete For Mac
Share. LinkedIn. Facebook. Twitter 2 I use git from the command line all day long. In the process, I issue a lot of git commands.
This can get (no pun intended) to be a lot of repetitive typing, especially when branch names get long. Tremulous 1.1.0 for mac. To illustrate, it’s no fun to type out git checkout feature/shiny- new-processing-system-database-optimization every time I want to checkout that branch.
Of course, you can always use the mouse to copy and paste a long branch name rather than typing the whole thing out. However, if you’re like me and like to keep your hands on the keyboard, this solution can feel slow.
Mac Git Bash Completion
Tab completion would certainly be faster and easier. Unfortunately, the default install of git on some Mac computers doesn’t have tab completion enabled. This was the case for me and at least two of my coworkers. Fortunately, this is an easy fix. There is a bash script that enables tab completion of git commands and branch names. At the time of writing, this exists in git’s official repo on Github. In fact, it is likely that this file already exists on your local machine, but, if you’re reading this post, you probably haven’t tapped into its power, yet.
Git Autocomplete Mac
In the rest of this article, I will show you how to enable git tab completion in bash on a Mac. The first step is to figure out whether you already have the git-completion script on your machine. You can use the following command to see if the script already exists on your local machine. Sudo find / - type f -name 'git-completion.bash' Note: the sudo command will require you to enter the password you use to log in to your Mac. Also, this command may take a minute to run, because it looks through your whole file system. Here are some possible locations for the git-completion script, but it’s okay if it’s somewhere else.