development

BREW 업데이트 : 다음 추적되지 않은 작업 트리 파일을 병합하여 덮어 씁니다.

big-blog 2020. 2. 27. 22:21
반응형

BREW 업데이트 : 다음 추적되지 않은 작업 트리 파일을 병합하여 덮어 씁니다.


실행하려고했는데 brew update병합하면 로컬 변경 내용이 손실 될 수 있다는 오류가 발생합니다. 나는 내 지역 변화를 저 지르려고 노력했지만 (생각하지는 않았지만 잠시만 기다려야 함) 상황이 악화되었습니다.

출력은 다음과 같습니다.

MBP:Library User$ sudo brew update
error: The following untracked working tree files would be overwritten by merge:
    Library/Aliases/fastcgi
    Library/Aliases/htop
    Library/Aliases/nodejs
    Library/Aliases/ocio
    Library/Aliases/oiio
    Library/Aliases/pgrep
    Library/Aliases/pkill
    Library/Contributions/cmds/brew-beer.rb
    Library/Contributions/cmds/brew-dirty.rb
    Library/Contributions/cmds/brew-graph
    Library/Contributions/cmds/brew-grep
    Library/Contributions/cmds/brew-leaves.rb
    Library/Contributions/cmds/brew-linkapps.rb
    Library/Contributions/cmds/brew-man
    Library/Contributions/cmds/brew-mirror-check.rb
    Library/Contributions/cmds/brew-missing.rb
    Library/Contributions/cmds/brew-pull.rb
    Library/Contributions/cmds/brew-readall.rb
    Library/Contributions/cmds/brew-server
    Library/Contributions/cmds/brew-services.rb
    Library/Contributions/cmds/brew-switch.rb
    Library/Contributions/cmds/brew-test-bot.commit.html.erb
    Library/Contributions/cmds/brew-test-bot.css
    Library/Contributions/cmds/brew-test-bot.index.html.erb
    Library/Contributions/cmds/brew-test-bot.rb
    Library/Contributions/cmds/brew-tests.rb
    Library/Contributions/cmds/brew-unpack.rb
    Library/Contributions/cmds/brew-which.rb
    Library/Contributions/install_homebrew.rb
    Library/Formula/abcl.rb
    Library/Formula/abyss.rb
    Library/Formula/akka.rb
    Library/Formula/apollo.rb
    Library/Formula/appledoc.rb
    Library/Formula/arangodb.rb
    Library/Formula/autoconf.rb
    Library/Formula/automake.rb
    Library/Formula/avidemux.rb
    Library/Formula/bind.rb
    Library/Formula/bsdconv.rb
    Library/Formula/bsdmake.rb
    Library/Formula/camellia.rb
    Library/Formula/cbmbasic.rb
    Library/Formula/cdo.rb
    Library/Formula/checkstyle.rb
    Library/Formula/cifer.rb
    Library/Formula/clhep.rb
    Library/Formula/collada-dom.rb
    Library/Formula/crash.rb
    Library/Formula/crossroads.rb
    Library/Formula/css-crush.rb
    Library/Formula/curlftpfs.rb
    Library/Formula/dart.rb
    Library/Formula/dasm.rb
    Library/Formula/dfc.rb
    Library/Formula/di.rb
    Library/Formula/dsniff.rb
    Library/Formula/dupx.rb
    Library/Formula/dwatch.rb
    Library/Formula/eprover.rb
    Library/Formula/ext2fuse.rb
    Library/Formula/ezlupdate.rb
    Library/Formula/f3.rb
    Library/Formula/fastx_toolkit.rb
    Library/Formula/fceux.rb
    Library/Formula/findbugs.rb
    Library/Formula/freerdp.rb
    Library/Formula/funcoeszz.rb
    Library/Formula/fwknop.rb
    Library/Formula/gabedit.rb
    Library/Formula/gbdfed.rb
    Library/Formula/gconf.rb
    Library/Formula/git-encrypt.rb
    Library/Formula/glm.rb
    Library/Formula/gmap-gsnap.rb
    Library/Formula/gnu-arch.rb
    Library/Formula/gnunet.rb
    Library/Formula/gobby.rb
    Library/Formula/gptfdisk.rb
    Library/Formula/griffon.rb
    Library/Formula/grok.rb
    Library/Formula/gtk-chtheme.rb
    Library/Formula/gtkglextmm.rb
    Library/Formula/gtmess.rb
    Library/Formula/hg-flow.rb
    Library/Formula/hqx.rb
    Library/Formula/htop-osx.rb
    Library/Formula/htpdate.rb
    Library/Formula/imap-uw.rb
    Library/Formula/iozone.rb
    Library/Formula/ipbt.rb
    Library/Formula/ipe.rb
    Library/Formula/ispc.rb
    Library/Formula/ispell.rb
    Library/Formula/jigdo.rb
    Library/Formula/jing.rb
    Library/Formula/jless.rb
    Library/Formula/jpeginfo.rb
    Library/Formula/konoha.rb
    Library/Formula/legit.rb
    Library/Formula/libcouchbase.rb
    Library/Formula/libcuefile.rb
    Library/Formula/libextractor.rb
    Library/Formula/libglademm.rb
    Library/Formula/libgtextutils.rb
    Library/Formula/libinfinity.rb
    Library/Formula/libkate.rb
    Library/Formula/libqalculate.rb
    Library/Formula/libqglviewer.rb
    Library/Formula/libreplaygain.rb
    Library/Formula/libtool.rb
    Library/Formula/libvbucket.rb
    Library/Formula/libvo-aacenc.rb
    Library/Formula/libxmi.rb
    Library/Formula/lifelines.rb
    Library/Formula/makeicns.rb
    Library/Formula/mathgl.rb
    Library/Formula/meld.rb
    Library/Formula/mesalib-glw.rb
    Library/Formula/minisat.rb
    Library/Formula/minuit2.rb
    Library/Formula/mobile-shell.rb
    Library/Formula/movgrab.rb
    Library/Formula/mp3cat.rb
    Library/Formula/mpich2.rb
    Library/Formula/mrfast.rb
    Library/Formula/musepack.rb
    Library/Formula/ndiff.rb
    Library/Formula/net6.rb
    Library/Formula/nrpe.rb
    Library/Formula/nuttcp.rb
    Library/Formula/oath-toolkit.
Updating aa07533..3f070ef
Aborting
Error: Failed while executing git pull  origin refs/heads/master:refs/remotes/origin/master

원점을 가져 오는 것을 잊지 마십시오 !!!

$ cd /usr/local
$ git fetch origin
$git reset --hard origin/master

관심있는 사람들을위한 설명 :

brew를 업데이트하려고하지만 brew 자체가 최신 상태가 아니거나 (가능한 경우) 일부 OS 업데이트를 통해 권한이 변경되었거나 brew가 약간 손상되었을 가능성이 있습니다. brew 자체는 git repo이므로 brew를 마스터 브랜치 버전으로 업데이트하거나 재설정해야합니다. brew [기본적으로]는 /usr/local폴더에 있으므로

  1. 해당 폴더로 이동하여 [첫 번째 명령] 권한을 업데이트해야합니다 (아래 표시되지 않은 경우).
  2. 추출의 원격 브랜치 LOCAL 버전을 업데이트하는 것을 의미하는 원점을 가져옵니다 [두 번째 명령].
  3. REMOTE 마스터 브랜치 (현재 권한도 사용)를 기반으로 하드 리셋 [3 차 명령].

chownsudo 또는 관리자 프로필이 아닌 경우 첫 번째 명령을 사용할 수도 있습니다
$ sudo chown -R `whoami` /usr/local
$ cd /usr/local
$git reset --hard origin/master

git reset을 이해하려면 이 기사를 살펴보십시오 .


몇 주 전에 이전 homebrew 설치를 업데이트하려고 할 때 비슷한 문제가 발생했습니다. 이것을하는 것 :

git reset --hard origin/master

인은 /usr/local나를 위해 그것을 해결했습니다.

다른 사람들 도이 문제를 겪은 것처럼 보입니다. 제안 된 해결 방법을 여기 에서 살펴 보셨습니까 ?


2012 년에 제안 된 것보다 조금 더 안전 해 보이므로 개인적인 경험을 추가하고 있습니다.

  1. 를 실행하십시오 brew doctor.
  2. 다음 경고가 표시되는 경우 :

    Warning: The /usr/local directory is not writable.
    

    운영:

    sudo chown -R `whoami` /usr/local
    

    Chris Frisina가 제안한 권한 문제를 해결합니다. 결국 brew doctor경고가 사라 졌는지 확인하기 위해 다시 실행 하십시오.

  3. 이제, 당신은

    Warning: You have uncommitted modifications to Homebrew
    

    그에 의해 해결 될 수 있습니다

    cd /usr/local/Library && git stash && git clean -d -f
    

    Dr.Brew 자체가 제안한대로. 이 명령은 커밋되지 않은 수정 사항을 숨기고 필요한 경우 다시 돌아가서 복구 할 수 있습니다. 나보다 안전 해 보였다 git reset --hard origin/master.

  4. 원하는 경우 여기 및 다른 SO 사용자가 제안한 단계로 문제가 해결되지 않으면 공식 문제 해결 안내서를 확인하십시오.


비슷한 대답이지만 더 이상 추적되지 않는 파일이 있으면 /usr/local실행 에서 추가 단계가 필요 합니다.

git fetch origin
git clean -f
git reset --hard origin/master

이 방법은 일부 방법보다 간단 할 수 있습니다. 여기에는 다음이 포함됩니다.

  • 변경 사항 관리를 다시 위임 할 수 있도록 자식 문제 수정.
  • 파일이나 디렉토리의 수동 이동이 없습니다.
  • 파일 또는 디렉토리 권한을 수동으로 조정하지 않습니다.

단계 (설명을 원하는 사람들을위한 메모 포함) :

cd $(brew --repository)                              // see Note 1 below
git remote add brew https://github.com/Homebrew/brew // see Note 2 below
git pull brew master                                 // promising fast-forward report!
brew update                                          // see Note 3 below 

개요 :
내가 알 수 있듯이이 문제의 실제 원인은 저장소 URL의 변경입니다. 지금 brew이었어요 brew.git. (전체 최신 URL : https://github.com/Homebrew/brew )

참고 1 :이 첫 번째 명령은 파일 구조의 어느 곳에서나 올바른 디렉토리로 이동합니다. 디렉토리 구조는 다른 사람들이 위에서 보여준 것과는 다르지만 (Mac OS 10.11.16)이 명령을 사용하면 이러한 차이는 중요하지 않습니다.

참고 2 :이 두 번째 명령은 올바른 원격 URL을 새 별칭에 추가합니다. 이 접근법이 내가 원하는 것을 달성하지 못하고 이전 주소가 다시 필요할 때를 대비하여 그렇게했습니다. 새로운 리모컨이 작동했기 때문에 다른 사람을 초대하여 별명으로 URL을 변경하는 것에 대해 언급하도록하겠습니다. 도움이 된 내용을 반영하여 답변을 기쁘게 업데이트하겠습니다.

참고 3 :이 네 번째 명령은 정확히 원하는 결과를 얻습니다. 특히 "==> HOMEBREW_REPOSITORY를 / usr / local / Homebrew로 마이그레이션"이라는 멋진 보고서를 포함하여 많은 수의 업데이트를보고합니다. (강조).

참고 URL : https://stackoverflow.com/questions/10762859/brew-update-the-following-untracked-working-tree-files-would-be-overwritten-by



반응형