Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: add git command line completion

...

  1. Download pre-compiled version from https://github.com/github/hub/releases and un-tar the package.
  2. cp hub ~/bin                                                      # or somewhere in your $PATH
  3. If git protocol is blocked by your firewall, set the default protocol to https
    • git config --global hub.protocol https
  4. cp etc/hub.bash_completion.sh ~/lib                 # somewhere to reference it in your .bashrc file
  5. Update your shell resource file:

    Code Block
    languagebash
    title~/.bashrc
    collapsetrue
    source ~/lib/hub.bash_completion.sh
    alias git=hub

Git Customization

Bash customization is highly recommended if you are a regular git user. Command completion enables the shell to auto-complete git sub-commands, branch names, etc.

Source the command completion and prompt files in via your shell resource file:

 

Code Block
languagebash
title~/.bashrc
collapsetrue
source /usr/share/doc/git-*/contrib/completion/git-completion.bash
source /usr/share/doc/git-*/contrib/completion/git-prompt.sh
# some versions of git it is elsewhere:
# source /etc/bash_completion.d/git

# Set multi-color, git-aware prompt (git branch and working dir) - customize as desired
# bash(1) colors:  http://www.cplusplus.com/forum/unices/36461/
# 2;33 = dark yellow
# 0;31 = red
# 0m = default color
# \! = command history number
# \w = working dir
PS1='\033[2;33m# \! $(__git_ps1 "\033[0;31m(%s)\033[2;33m ")\w\n\033[2;33m#> \033[0m'

 

Content by Label
showLabelsfalse
max5
spacesTRAFODION
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "TRAFODION"
labelskb-how-to-article

...