bobthecow / git-flow-completion

Bash, Zsh and fish completion support for git-flow.
MIT License
2.79k stars 386 forks source link

git-completion, OS X, Homebrew instructions for ZSH #50

Open phillpafford opened 7 years ago

phillpafford commented 7 years ago

https://github.com/bobthecow/git-flow-completion/wiki/Update-Zsh-git-completion-module

Replace /usr/share/zsh/x.x.xx/functions/_git

In newer versions of OSX this file is restricted

Issue ls -lO /usr/share/zsh/x.x.xx/functions/_git

(capital letter 'oh', not zero);

if you see restricted, SIP is protecting that directory tree.

Solution (from the linked answer):

boot into recovery mode (Command-R during boot) In terminal, issue crsutil disable Reboot to normal mode. You should see that SIP is no longer blocking write access. If you later want to restore SIP, just use crsutil enable in recovery mode.

source: https://superuser.com/a/1159330/8036

dhanifudin commented 6 years ago

or we can use this step as snoepkast mention here

tested on

ulfw commented 6 years ago

it does not work with

Mac OS 10.13.5 zsh 5.5.1 (installed via brew) git 2.18.0 (installed via brew install git --without-completions)

anymore

ElRochito commented 5 years ago

On MacOS 10.13.6

I've same problem with git version installed via brew.

I've tried brew install git --without-completions but Error: invalid option: --without-completions

any ideas ?

ElRochito commented 5 years ago

Found a solution :

brew uninstall --force git
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/db579a4f633c3dfde12c5236b9ea0695dce6cc5e/Formula/git.rb --without-completions
brew pin git
zx1986 commented 5 years ago

git version => 2.20.1 zsh => 5.6.2 (x86_64-apple-darwin18.0.0) git flow version => 1.11.0 (AVH Edition)

oh-my-zsh plugins:

plugins=(
  zsh-syntax-highlighting
  zsh-autosuggestions
  zsh-completion
  git
  gitignore
  git-flow-completion
  docker
  vi-mode
  compleat
  colored-man-pages
  ssh-agent
  urltools
  osx
  pj
  k
  z
  rails
  django
  history-substring-search
)

not working :-(

ElRochito commented 5 years ago

Did you run exactly the same commands as above ?

Because with my command git is installed in version 2.18.0 but yours is 2.20.1 ...

lmasaya commented 5 years ago

On MacOS 10.13.6

I've same problem with git version installed via brew.

I've tried brew install git --without-completions but Error: invalid option: --without-completions

any ideas ?

Worked for me although it gave an error about being deprecated. Just redirect stderr to /dev/null if you hate the error message. $ zsh --version zsh 5.6.2 (x86_64-apple-darwin17.7.0) $ git version git version 2.20.1

ElRochito commented 5 years ago

Yes but when you checked git.rb cask, completions are installed always

zx1986 commented 5 years ago

My life was saved by https://github.com/Homebrew/homebrew-core/commit/f710a1395f44224e4bcc3518ee9c13a0dc850be1

sfehlandt commented 4 years ago

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/db579a4f633c3dfde12c5236b9ea0695dce6cc5e/Formula/git.rb --without-completions

Thanks, this did the trick. Its a shame we can't install the latest git version without completions.

Is there any other workaround to bypass the completion from brews git, so we can have the latest git and force zsh not to use its completions?