git-completion, OS X, Homebrew instructions for ZSH
phillpafford opened this issue ยท 10 comments
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.
or we can use this step as snoepkast mention here
brew uninstall git
brew install git --without-completions
- then source file e.g
source ~/.zsh/git-flow-completion/git-flow-completion.zsh
tested on
- Mac OS 10.13.2
- zsh 5.4.2 (x86_64-apple-darwin16.6.0) (installed via brew)
- git version 2.16.1 (installed via brew)
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
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 ?
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
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 :-(
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 ...
On MacOS 10.13.6
I've same problem with git version installed via brew.
I've tried
brew install git --without-completions
butError: 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
Yes but when you checked git.rb
cask, completions are installed always
My life was saved by Homebrew/homebrew-core@f710a13
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?