Fatal: The pre-rebase hook refused to rebase


#1

I can’t figure out why brew throws this fatal error and appears not be able to update repos. Notice that I have to go directly into the tap and git pull.

$ brew update
.git/hooks/pre-rebase: line 2: git-hooks: command not found
fatal: The pre-rebase hook refused to rebase.
Already up-to-date.

$ brew tap
Updating Homebrew...
.git/hooks/pre-rebase: line 2: git-hooks: command not found
fatal: The pre-rebase hook refused to rebase.
cloudfoundry/tap
homebrew/cask
homebrew/core

$ brew install cf-cli
.git/hooks/pre-rebase: line 2: git-hooks: command not found
fatal: The pre-rebase hook refused to rebase.
==> Installing cf-cli from cloudfoundry/tap
==> Downloading https://packages.cloudfoundry.org/stable?release=macosx64-binary&version=6.36.1&source=homebrew
==> Downloading from https://s3-us-west-1.amazonaws.com/cf-cli-releases/releases/v6.36.1/cf-cli_6.36.1_osx.tgz
######################################################################## 100.0%
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/cf-cli/6.36.1: 6 files, 17.7MB, built in 3 seconds

$ cd /usr/local/Homebrew/Library/Taps/cloudfoundry/homebrew-tap/

$ git status
On branch master
Your branch is behind 'origin/master' by 89 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean

$ git pull
Updating da88378..8a42f6f
Fast-forward
 README.md      | 17 +++++++++--------
 bbl.rb         |  6 +++---
 bbr.rb         | 16 ++++++++++++++++
 bosh-cli.rb    |  4 ++--
 cf-cli.rb      | 10 +++++-----
 cf7-cli.rb     | 43 +++++++++++++++++++++++++++++++++++++++++++
 credhub-cli.rb |  6 +++---
 7 files changed, 81 insertions(+), 21 deletions(-)
 create mode 100644 bbr.rb
 create mode 100644 cf7-cli.rb

$ brew upgrade cf-cli
.git/hooks/pre-rebase: line 2: git-hooks: command not found
fatal: The pre-rebase hook refused to rebase.
==> Upgrading 1 outdated package:
cloudfoundry/tap/cf-cli 6.36.1 -> 6.43.0
==> Upgrading cloudfoundry/tap/cf-cli
==> Downloading https://packages.cloudfoundry.org/homebrew/cf-6.43.0.tgz
==> Downloading from https://s3-us-west-1.amazonaws.com/cf-cli-releases/releases/v6.43.0/cf-cli_6.43.0_osx.tgz
######################################################################## 100.0%
j==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/cf-cli/6.43.0: 6 files, 21.6MB, built in 3 seconds
Removing: /usr/local/Cellar/cf-cli/6.36.1... (6 files, 17.7MB)
Removing: /Users/scoen/Library/Caches/Homebrew/cf-cli--6.36.1... (5.9MB)

$ brew upgrade cf-cli
.git/hooks/pre-rebase: line 2: git-hooks: command not found
fatal: The pre-rebase hook refused to rebase.
Error: cloudfoundry/tap/cf-cli 6.43.0 already installed

(Sean Molenaar) #2

It seems you installed a git hook for homebrew. If this is the casels $(brew --repo <REPO_NAME>)/.git/hooks/pre-rebase will return a file path. If you append .sample to the filename it’ll deactivate and hopefully stop complaining.


#3
$ brew upgrade cf-cli
.git/hooks/pre-rebase: line 2: git-hooks: command not found
fatal: The pre-rebase hook refused to rebase.
Error: cloudfoundry/tap/cf-cli 6.43.0 already installed

$ ls $(brew --repo cloudfoundry/tap)/.git/hooks/pre-rebase
ls: /usr/local/Homebrew/Library/Taps/cloudfoundry/homebrew-tap/.git/hooks/pre-rebase: No such file or directory

I’m confused what value to put for REPO_NAME, when I get this failure for every brew command.


(Sean Molenaar) #4

I’d say homebrew/core


#5

File not found. Any other suggestions? Thank you very much for the help.

$ ls $(brew --repo homebrew/core)/.git/hooks/pre-rebase
ls: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/hooks/pre-rebase: No such file or directory