我尝试运行 brew update,但出现错误,提示如果我 merge ,我的本地更改将会丢失。我尝试提交我的本地更改(不记得做了什么,但已经有一段时间了),这让事情变得更糟。
这是输出:
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/Homebrew
git fetch origin
git reset --hard origin/master
发生的情况是您正在尝试更新 brew,但 brew 本身不是最新的(可能),通过某些操作系统更新(也可能)更改了权限,或者 brew 略有损坏(不太可能)。由于 brew 本身是一个 git repo,因此您必须将 brew 更新或重置为 master 分支版本。 brew [默认情况下] 位于 /usr/local/Homebrew 文件夹中,因此您
如果您处于非 sudo 或管理员配置文件中,您还可以chown第一个命令
sudo chown -R `whoami` /usr/local/Homebrew
cd /usr/local/Homebrew
git reset --hard origin/master
要了解 git reset,请查看 this article .
关于git - brew 更新 : The following untracked working tree files would be overwritten by merge:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10762859/
给定这段代码defcreate@upgrades=User.update_all(["role=?","upgraded"],:id=>params[:upgrade])redirect_toadmin_upgrades_path,:notice=>"Successfullyupgradeduser."end我如何在该操作中实际验证它们是否已保存或未重定向到适当的页面和消息? 最佳答案 在Rails3中,update_all不返回任何有意义的信息,除了已更新的记录数(这可能取决于您的DBMS是否返回该信息)。http://ar.ru
我将应用程序升级到Rails4,一切正常。我可以登录并转到我的编辑页面。也更新了观点。使用标准View时,用户会更新。但是当我添加例如字段:name时,它不会在表单中更新。使用devise3.1.1和gem'protected_attributes'我需要在设备或数据库上运行某种更新命令吗?我也搜索过这个地方,找到了许多不同的解决方案,但没有一个会更新我的用户字段。我没有添加任何自定义字段。 最佳答案 如果您想允许额外的参数,您可以在ApplicationController中使用beforefilter,因为Rails4将参数
文章目录git常用命令(简介,详细参数往下看)Git提交代码步骤gitpullgitstatusgitaddgitcommitgitpushgit代码冲突合并问题方法一:放弃本地代码方法二:合并代码常用命令以及详细参数gitadd将文件添加到仓库:gitdiff比较文件异同gitlog查看历史记录gitreset代码回滚版本库相关操作远程仓库相关操作分支相关操作创建分支查看分支:gitbranch合并分支:gitmerge删除分支:gitbranch-ddev查看分支合并图:gitlog–graph–pretty=oneline–abbrev-commit撤消某次提交git用户名密码相关配置g
我正在尝试为我的iOS应用程序设置cocoapods但是当我执行命令时:sudogemupdate--system我收到错误消息:当前已安装最新版本。中止。当我进入cocoapods的下一步时:sudogeminstallcocoapods我在MacOS10.8.5上遇到错误:ERROR:Errorinstallingcocoapods:cocoapods-trunkrequiresRubyversion>=2.0.0.我在MacOS10.9.4上尝试了同样的操作,但出现错误:ERROR:Couldnotfindavalidgem'cocoapods'(>=0),hereiswhy:U
这太简单了,太荒谬了,我在任何地方都找不到关于它的任何信息,包括API文档和Rails源代码:我有一个:belongs_to关联,我开始理解当您没有关联时您在Controller中调用的正常模型方法与您有关联时调用的方法略有不同。例如,我的关联在创建Controller操作时运行良好:@user=current_user@building=Building.new(params[:building])respond_todo|format|if@user.buildings.create(params[:building])#etcetera但我找不到关于更新如何工作的文档:@user
关于如何使用git设置类似Dropbox的服务,您有什么建议吗?您认为git是解决此问题的合适工具吗?我在考虑使用git+rush解决方案,你觉得怎么样? 最佳答案 检查这个开源项目:https://github.com/hbons/SparkleShare来自项目的自述文件:Howdoesitwork?SparkleSharecreatesaspecialfolderonyourcomputer.Youcanaddremotelyhostedfolders(or"projects")tothisfolder.Theseprojec
我编写了一个非常简单的“部署”脚本,作为我的裸git存储库中的post-updateHook运行。变量如下livedomain=~/mydomain.comstagingdomain=~/stage.mydomain.comgitrepolocation=~/git.mydomain.com/thisrepo.git(bare)core=~/git.mydomain.com/thisrepo.gitcore==addedremoteintoeachlive&stagegitslive和stage都初始化了gitrepos(非裸),我已经将我的裸仓库作为远程添加到它们中的每一个(名为co
我正在安装gitlabhq,并且在Gemfile中有对某些资源的“git://...”的引用。但是,我在公司防火墙后面,所以我必须使用http://。我可以手动编辑Gemfile,但我想知道是否有另一种方法告诉bundler使用http://作为git存储库? 最佳答案 您可以通过运行gitconfig--globalurl."https://".insteadOfgit://或通过将以下内容添加到~/.gitconfig:[url"https://"]insteadOf=git://
升级到OSXYosemite后,我现有的pow.cx安装不起作用。升级到最新的pow.cx无效。通过事件监视器重新启动它也没有成功。 最佳答案 卸载(!)并重新安装解决了这个问题。curlget.pow.cx/uninstall.sh|shcurlget.pow.cx|sh 关于ruby-on-rails-OSXYosemite更新破坏了pow.cx,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/q
我们在Ubuntu14.04和Gitlab9.3.7上运行,运行良好。我们正在尝试更新到Gitlabv9.3.8的最新安全补丁,但它给我们这个错误:Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension.currentdirectory:/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/re2-1.0.0/ext/re2/usr/local/bin/ruby-r./siteconf20170720-19622-15i0edf.rbextconf.rbcheckingformain(