0

When I type in the command go get -u github.com/ndelphit/apkurlgrep

I get the error

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 github.com/ndelphit/apkurlgrep: exit status 1

Ferdinand
  • 513
  • 1
  • 3
  • 9
  • 1
    i can't repro this error... have you done anything to your environment? – kylieCatt Mar 10 '22 at 21:41
  • 1
    That error comes from git, you probably have a corrupt clone cached locally – JimB Mar 11 '22 at 02:57
  • @kylieCatt no, I don't remember if I installed it using apt as a dependency for another program or if it comes with ubuntu. But I didn't touch anything in the environment – Ferdinand Mar 11 '22 at 08:20

2 Answers2

2

It depends on your local Go version and if you are doing the command from a go project (with its go.mod), or outside any project.

Inside a project, try a go clean -modcache, and your

go get github.com/ndelphit/apkurlgrep
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

After a little bit of digging, I found a similar issue here. One suggestion was to delete src from the go directory and this worked for me.

So here is what I did (Linux):

  1. Find the go folder (for me it is located in the home directory) and cd into it

    cd go

  2. List the contents of the go folder

    ls

  3. You should see the src folder, now delete it:

    rm -rf src

  4. Try the go get command again (for your package)

    go get -u github.com/ndelphit/apkurlgrep

  5. You shouldn't get the error, run the package that you have installed (in my case apkurlgrep) to see if it has been installed. It runs!

Ferdinand
  • 513
  • 1
  • 3
  • 9