git-flow-completion icon indicating copy to clipboard operation
git-flow-completion copied to clipboard

git-completion, OS X, Homebrew instructions for ZSH

Open phillpafford opened this issue 8 years ago • 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.

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

phillpafford avatar Sep 01 '17 02:09 phillpafford

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)

dhanifudin avatar Feb 03 '18 00:02 dhanifudin

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

ulfw avatar Jul 09 '18 09:07 ulfw

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 avatar Dec 15 '18 16:12 ElRochito

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

ElRochito avatar Dec 15 '18 16:12 ElRochito

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 :-(

zx1986 avatar Dec 18 '18 08:12 zx1986

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 ...

ElRochito avatar Jan 09 '19 12:01 ElRochito

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

lmasaya avatar Jan 11 '19 22:01 lmasaya

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

ElRochito avatar Jan 14 '19 15:01 ElRochito

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

zx1986 avatar Feb 22 '19 10:02 zx1986

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?

sfehlandt avatar Nov 29 '19 14:11 sfehlandt