Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
phillpafford opened this issue Sep 1, 2017 · 10 comments
Open

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

phillpafford opened this issue Sep 1, 2017 · 10 comments

Comments

@phillpafford
Copy link

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
Copy link

dhanifudin commented Feb 3, 2018

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)

@ulfw
Copy link

ulfw commented Jul 9, 2018

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
Copy link

ElRochito commented Dec 15, 2018

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
Copy link

ElRochito commented Dec 15, 2018

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
Copy link

zx1986 commented Dec 18, 2018

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
Copy link

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
Copy link

lmasaya commented Jan 11, 2019

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
Copy link

ElRochito commented Jan 14, 2019

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

@zx1986
Copy link

zx1986 commented Feb 22, 2019

My life was saved by Homebrew/homebrew-core@f710a13

@sfehlandt
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants