Question: This is breaking 

```
alias f='git flow feature'
complete -F __git_flow_feature f

```

It works eventually (after 2 'tabs') but throws an error on each 'tab' press. 

```
-bash: [: 1: unary operator expected

```

Any ideas?

Answer: 
It works for me, when I do:

1. wget <http://www.triquanta.nl/sites/default/files/git-flow.bash>
2. source git-flow.bash
3. alias f='git flow feature'
4. complete -F \_\_git\_flow\_feature f
5. f `tab``tab`

Anyhow, the most common reason for the *"[: 1: unary operator expected"* error is that you have in the shell script code like:

```
if [ 1 = $MYVAL ] 

```

and your `MYVAL` is not set. Inspect your completion functions. You can add `set -x` to debug it.

Usually the easiest solution is to quote the variable so the operator will get the empty argument, but will have correct number of arguments:

```
if [ 1 = "$MYVAL" ] 

```
I have this aliases:

```
alias gn="git-number"
alias gb="gn -c git blame"
alias ge="gn -c $EDITOR"
alias ga="gn add"
alias gr="gn -c git reset"
alias gap="EDITOR='$EDITOR -w' gn add -p"
alias gd="gn -c git diff -b -w --ignore-blank-lines"
alias gds="gd --staged"
alias gc="gn -c git checkout"
alias gcf="git flow feature checkout"
alias gl="gn -c git log -w -b -p --ignore-blank-lines"
alias gls="git log --stat"
alias cm="EDITOR='$EDITOR -w' git commit"
alias grb="git stash save 'REBASE' && EDITOR='$EDITOR -w' git rebase -i"
alias grbc="EDITOR='$EDITOR -w' git rebase --continue"

gcd() {
    test -n "$1" && cd $(dirname $(git list $1))
}

source ~/.git-completion.bash
__git_complete gn  _git
__git_complete ga  _git_add
__git_complete gap _git_add
__git_complete gd  _git_diff
__git_complete gds _git_diff
__git_complete gc  _git_checkout
__git_complete gcf _git_checkout
__git_complete gl  _git_log
__git_complete gls _git_log
__git_complete cm  _git_commit

source ~/.git-flow-completion.bash

```

And install `completion` scripts as:

```
wget -O ~/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
wget -O ~/.git-flow-completion.bash https://raw.githubusercontent.com/petervanderdoes/git-flow-completion/develop/git-flow-completion.bash    

```

Git number noted here is: <https://github.com/holygeek/git-number>
Just copy binaries at repo to `~/bin`