0

I want to install mongoDB-driver. When I type this command

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

I got :

    #  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
Jinnrry
  • 405
  • 1
  • 5
  • 18
  • Have you already got this package before? If so you may need to go to the local directory and run `git pull origin master` – AJR Jul 01 '19 at 07:29

1 Answers1

2

Probably because you've already checked out that repo into your Go path, and have changed to a non-default branch. The simplest way to correct it would be to remove that repo, and start from scratch.

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

Of course, this will lose any changes you've made in that repo.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189