2013-07-25 10 views
65

Używam:Homebrew aktualizacja powiedzie: „proszę, swoje zmiany lub schować je, zanim będzie można scalić”

brew update 

I pojawia się błąd:

error: Your local changes to the following files would be overwritten by merge: 
    samtools.rb 
Please, commit your changes or stash them before you can merge. 
Aborting 

Okazuje się to znany błąd. W rzeczywistości, to wymienione na Homebrew wiki:

After running brew update, you receive a git error warning about untracked files or local changes that would be overwritten by a checkout or merge, followed by a list of files inside your Homebrew installation. 

This is caused by an old bug in in the update code that has long since been fixed. However, the nature of the bug requires that you do the following: 

cd $(brew --repository) 
git reset --hard FETCH_HEAD 

If brew doctor still complains about uncommitted modifications, also run this command: 

cd $(brew --repository)/Library 
git clean -fd 

I przestrzegać tych wskazówek i wciąż widząc ten sam błąd. Co jest nie tak?

Odpowiedz

104

Sam udało mi się rozwiązać problem.

Co mnie dowiodło, że "status git" nie pokazuje tego pliku.

Zamiast wspólnego rozwiązania:

cd $(brew --repository) 
git reset --hard FETCH_HEAD 

musiałem zrobić:

cd [directory of the file in question] 
git reset --hard FETCH_HEAD 

To rozwiązało problem.

+0

Dzięki! naprawił jeden z moich konfliktów git. Czym dokładnie jest reset git --hard FETCH_HEAD? –

+0

Kiedy miałem ten problem, musiałem sprawdzić plik naruszający prawa, który był w/usr/local/Formula/Library, a następnie "git reset --hard FETCH_HEAD" po aktualizacji parzenia pracował – petrocket

+0

Zrobiłem to dla mnie, dziękuję bardzo do dzielenia się! –

2

miałem ten problem po ręcznego korygowania URL w numpy formule. Mogłem to poprawić później:

cd /usr/local/Library/Taps/homebrew/homebrew-python 
git checkout -- numpy.rb 
brew update 
Powiązane problemy