Go-get为什么要我选一个分支?

时间:2019-07-01 07:11:58

标签: go go-get

我想安装mongoDB驱动程序。当我键入此命令

go get go.mongodb.org/mongo-driver/mongo

我得到了:

    #  cd /Users/jiangwei/go/src/go.mongodb.org/mongo-driver; git pull --ff-only
    There is no tracking information for the current branch.
    Please specify which branch you want to merge with.
    See git-pull(1) for details.

    git pull <remote> <branch>

    If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master

    package go.mongodb.org/mongo-driver/mongo: exit status 1

1 个答案:

答案 0 :(得分:1)

可能是因为您已经将该仓库签出到Go路径中,并且已更改为非默认分支。纠正它的最简单方法是删除该存储库,然后从头开始。

rm -rf $(go env GOPATH)/src/go.mongodb.org/mongo-driver

当然,这将丢失您在该存储库中所做的任何更改。