0

I am getting following error:

error: The following untracked working tree files would be overwritten by merge:
    share/doc/homebrew/Analytics.md
    share/doc/homebrew/Checksum_Deprecation.md
    share/doc/homebrew/How-to-Create-and-Maintain-a-Tap.md
    share/doc/homebrew/Kickstarter-Supporters.md
    share/doc/homebrew/Maintainers-Avoiding-Burnout.md
    share/doc/homebrew/Node-for-Formula-Authors.md
    share/doc/homebrew/Prose-Style-Guidelines.md
    share/doc/homebrew/Rename-A-Formula.md
    share/doc/homebrew/brew.1.html
    share/doc/homebrew/images/analytics.png
    share/doc/homebrew/images/brew-test-bot-failed-jenkins.png
    share/doc/homebrew/images/brew-test-bot-failed-pr.png
    share/doc/homebrew/images/brew-test-bot-failed-test.png
    share/doc/homebrew/images/brew-test-bot-passed-jenkins.png
    share/doc/homebrew/images/brew-test-bot-passed-pr.png
    share/doc/homebrew/images/brew-test-bot-triggered-pr.png
    share/zsh/site-functions/_brew
Please move or remove them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
Volatil3
  • 14,253
  • 38
  • 134
  • 263
  • Would you have any clarifications whether you've done something else before this happened? Moved a directory or files around, changed settings for Homebrew, changed permissions or owner for the respective files, etc? Also, can you try and run `brew doctor` to see if that comes up with any suggestions how to solve this? –  May 15 '16 at 10:14
  • Yes, I did a `git add -A` in `/usr/local`. Also prior to that I ran `git stash` – Volatil3 May 15 '16 at 10:15
  • Simple question: why did you do that? Brew has its git respository in `/usr/local`, so you were changing Homebrew's repo; that will obviously lead to troubles, so there must've been a good reason (or a simple accident) why you did that. –  May 15 '16 at 10:16
  • Just did it by mistake :/ - How should I revert all things? – Volatil3 May 15 '16 at 10:19
  • I guess you're question has now become "how do I undo 'git add --all'"? –  May 15 '16 at 10:22
  • Run `git rm --cached ` for each file listed by Homebrew. See eg http://stackoverflow.com/questions/1143796/remove-a-file-from-a-git-repository-without-deleting-it-from-the-local-filesyste and http://stackoverflow.com/questions/3469741/remove-file-from-the-repository-but-keep-it-locally . –  May 15 '16 at 10:24
  • I did that by doing `git reset HEAD` but error remains there – Volatil3 May 15 '16 at 10:25
  • `git reset HEAD` won't undo a `git add --all`, as you noticed. You may want to (re)search a bit more before trying things. –  May 15 '16 at 10:26
  • I see this http://imgur.com/o3cRDoS - you say I run `git rm --cached` individually on these files? – Volatil3 May 15 '16 at 10:28
  • Yes. If you're hesitant, copy one file as a backup, try on one file first, then check with Homebrew if that file still shows up in the error. –  May 15 '16 at 10:29
  • Did you just get that listing in the image after `git reset HEAD`, or was that there before? –  May 15 '16 at 10:29
  • after doing a reset. – Volatil3 May 15 '16 at 10:31
  • @Evert These are Untracked files hence git rm will not work. – Volatil3 May 15 '16 at 10:35
  • ... Search around for 'undo git reset HEAD', or simply throw away all of homebrew (`/usr/local`) and re-install. –  May 15 '16 at 10:36
  • how can I just remove `homebrew`? – Volatil3 May 15 '16 at 10:46
  • It says origin not found??With a non-standard origin, Homebrew won't pull updates from the main repository. The current git origin is: https://github.com/Homebrew/brew.git Unless you have compelling reasons, consider setting the origin remote to point at the main repository, located at: https://github.com/Homebrew/homebrew.git – Volatil3 May 15 '16 at 10:51
  • If you have not else but Homebrew installed software in `/usr/local`/, you can just nuke everything under `/usr/local` (including the `.git` directory), and reinstall everything. Annoying, but it'll work. And while you probably can restore the Homebrew git repository properly, that may take some doing and searching that you may not find worth the hassle. –  May 15 '16 at 12:23
  • @Evert There was an uninstall script provided by Brew guys, it took care of it. I reinstalled and so far working fine. Though I am not sure what applications have got screwed up so far. – Volatil3 May 16 '16 at 05:53

0 Answers0