brew: Broken repo after brew/core split

During an attempt to update my own copy of the Homebrew repository after it was split in two upstream and I ran brew update -vd to reflect this change, I was presented with the following output upon running git -C $(brew --repository) push -v…:

Pushing to https://github.com/RandomDSdevel/homebrew.git
To https://github.com/RandomDSdevel/homebrew.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/RandomDSdevel/homebrew.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

…and git -C $(brew --repository) pull -v RandomDSdevel, …:

From https://github.com/RandomDSdevel/homebrew
 = [up to date]      master     -> RandomDSdevel/master
Auto-merging share/man/man1/brew.1
CONFLICT (add/add): Merge conflict in share/man/man1/brew.1
[etc, ad nauseum; gist: https://gist.github.com/tdsmith/69cc90ab0914014e8e0ab8c9b2c9f266]

…, respectively. Even after running the following commands…:

  • sudo chown -Rv $(whoami) /usr/local
  • sudo chmod -R +a "zadmin allow delete,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,list,search,add_file,add_subdirectory,delete_child,read,write,append,execute,file_inherit,directory_inherit" /usr/local
  • sudo chmod -R +a "bryce allow delete,readattr,writeattr,readextattr,writeextattr,readsecurityritesecurity,list,search,add_file,add_subdirectory,delete_child,read,write,append,execute,file_inherit,directory_inherit" /usr/local
  • sudo chmod -R +a "_developer allow delete,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,list,search,add_file,add_subdirectory,delete_child,read,write,append,execute,file_inherit,directory_inherit" /usr/local

…in an attempt to remedy any permissions errors I might be having that might have made things worse, I still got errors while trying to push and pull from my Homebrew fork, though, this time, they were different: for git -C $(brew --repository) push -v, I got this, …:

/usr/local/Library/brew.sh: line 1: syntax error near unexpected token `<<<'
/usr/local/Library/brew.sh: line 1: `<<<<<<< HEAD'
fatal: Cannot change to 'push': No such file or directory

…, whereas for git -C $(brew --repository) pull -v RandomDSdevel, I got this:

/usr/local/Library/brew.sh: line 1: `<<<<<<< HEAD'
fatal: Cannot change to 'pull': No such file or directory

When trying to run brew update -vd, I got this:

/usr/local/Library/brew.sh: line 1: syntax error near unexpected token `<<<'
/usr/local/Library/brew.sh: line 1: `<<<<<<< HEAD'

Essentially, I think I just completely messed up my Homebrew install! I’m not entirely sure what to do to fix it, so can you guys help me fix it, please?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (15 by maintainers)

Most upvoted comments

@diversario No, this is unrelated. Please open a new issue and try to include a bit more information (what was the behavior in the past, what did you expect to happen, …) so we have a chance to help you.

@mikemcquaid: Thanks for clearing that up. Should we update Homebrew’s documentation to let other contributors know that this is the recommended course of action, though? I imagine that I might not end up being the only one getting confused by errors otherwise.

Yeh, you should refork either Homebrew/brew or Homebrew/homebrew-core as desired and then you can git rebase -i your local branches on the new master and push them to your new forks.