Gocode工具错误

huangapple go评论92阅读模式
英文:

Gocode tool error

问题

我想安装gocode,但每当我尝试运行命令:go get -u github.com/nsf/gocode

我会得到以下错误信息:

错误:合并时将覆盖以下文件的本地更改:
autocompletecontext.go
autocompletefile.go
decl.go
emacs-company/README.md
emacs-company/company-go.el
package.go
package_bin.go
package_text.go
utils.go

请在合并之前提交或隐藏您的更改。中止更新46e8fd2..5070dac包github.com/nsf/gocode:退出状态1

那么,我该如何强制合并或覆盖列出的文件呢?谢谢。

英文:

I want to install gocode but whenever i try the command: go get -u github.com/nsf/gocode<br /><br/>
I get the error below:

error: Your local changes to the following files would be overwritten by merge:
autocompletecontext.go
autocompletefile.go
decl.go
emacs-company/README.md
emacs-company/company-go.el
package.go
package_bin.go
package_text.go
utils.go

Please commit your changes or stash them before you merge.Aborting Updating 46e8fd2..5070dac package github.com/nsf/gocode: exit status 1

so how do i force merge or overwrite the listed files. Thanks

答案1

得分: 2

我不确定为什么你对gocode仓库进行了更改,但你可以根据你的需求选择以下两种操作之一。

你不关心本地更改:

cd $GOPATH/src/github.com/nsf/gocode
git checkout -- .
go get -u github.com/nsf/gocode

在这里,你删除了本地更改,然后更新了gocode,这样就不会再有合并冲突了。

你想保留本地更改,出于某种原因:

cd $GOPATH/src/github.com/nsf/gocode
git stash
go get -u github.com/nsf/gocode
git stash apply

在这里,你将你的更改进行了存储,并在更新代码后再次应用它们。

英文:

I am not sure why do you have changes on the gocode repository but you can do one of two things, depending of what you want.

You don't care about your local changes:

cd $GOPATH/src/github.com/nsf/gocode
git checkout -- .
go get -u github.com/nsf/gocode

Here you are deleting your local changes and then updating gocode, so you don't have merge conflicts anymore.

You want to keep your local changes for some reason:

cd $GOPATH/src/github.com/nsf/gocode
git stash
go get -u github.com/nsf/gocode
git stash apply

Here you are stashing your changes and applying them again after updating the code.

huangapple
  • 本文由 发表于 2016年12月5日 13:50:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/40967859.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定