From d0df01645e8dfaf38f8bb6d6da33c1bef21bd7fc Mon Sep 17 00:00:00 2001 From: Heitor Tashiro Sergent Date: Tue, 13 Oct 2015 15:49:14 -0500 Subject: [PATCH] Update zsh instructions and add bash instructions --- etc/README.md | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/etc/README.md b/etc/README.md index 6b30d61f..f076615d 100644 --- a/etc/README.md +++ b/etc/README.md @@ -1,5 +1,28 @@ # Installation instructions +## bash + +Open your `.bashrc` file and add: + +> If you want to set up Git to automatically have Bash shell completion for all users, copy the `hub.bash_completion` script to the `/opt/local/etc/bash_completion.d` directory on Mac systems or to the `/etc/bash_completion.d/` directory on Linux systems. ([Source](https://git-scm.com/book/en/v1/Git-Basics-Tips-and-Tricks#Auto-Completion)) + +* [Link to git auto-completion bash file](https://github.com/git/git/blob/master/contrib/completion/git-completion.bash) + +```sh +# Make sure you've aliased hub to git +eval "$(hub alias -s)" + +# And make sure that the git auto-completion is being loaded +if [ -f /path/to/git-completion.bash ]; then + . /path/to/git-completion.bash +fi + +# Load hub autocompletion +if [ -f /path/to/hub.bash_completion ]; then + . /path/to/hub.bash_completion +fi +``` + ## zsh Create a new folder for completions: @@ -8,15 +31,16 @@ Create a new folder for completions: mkdir -p ~/.zsh/completions ``` -Download the file hub.zsh_completion and rename it to `_hub`: +Copy the file `/etc/hub.zsh_completion` from the location where you downloaded `hub` to the folder `~/.zsh/completions/` and rename it to `_hub`: ```sh -curl https://github.com/github/hub/blob/master/etc/hub.zsh_completion > ~/.zsh/completions/_hub +cp /path/to/etc/hub.zsh_completion ~/.zsh/completions/ \ + mv ~/.zsh/completions/hub.zsh_completion ~/.zsh/completions/_hub ``` -Then add the following lines to your .zshrc file: +Then add the following lines to your `.zshrc` file: ```sh fpath=(~/.zsh/completions $fpath) autoload -U compinit && compinit -``` \ No newline at end of file +``` -- GitLab