internal/stdlib: pass -f to git fetch in remoteGoRepo.clone

remoteGoRepo.clone inits a repo and then tries to fetch into the
"main" branch of the repo. But if the user's settings are for the
default branch to be called main, main will already exist and the
fetch command will fail. The -f flag will cause the command to do the
fetch even though the branch already exists.

For golang/go#63254
For golang/go#63744

Change-Id: I33f414654088a67eae4bfa70424d0dc6c34903f0
LUCI-TryBot-Result: Go LUCI <>
TryBot-Result: Gopher Robot <>
Reviewed-by: Bryan Mills <>
kokoro-CI: kokoro <>
Run-TryBot: Michael Matloob <>
1 file changed
tree: 74109c26a0aaa83943ef6b4ddaf7b59a56c1f4af
  1. .github/
  2. cmd/
  3. deploy/
  4. devtools/
  5. doc/
  6. internal/
  7. migrations/
  8. static/
  9. tests/
  10. third_party/
  11. .dockerignore
  12. .eslintignore
  13. .eslintrc.yaml
  14. .gitignore
  15. .prettierignore
  16. .prettierrc.yaml
  17. .stylelintignore
  18. .stylelintrc.yaml
  19. all.bash
  21. go.mod
  22. go.sum
  23. jest.config.js
  25. package-lock.json
  26. package.json
  29. tsconfig.json

This repository hosts the source code of the website, and pkgsite, a documentation server program.

Go Reference a site for discovering Go packages is a website for discovering and evaluating Go packages and modules.

You can check it out at

pkgsite: a documentation server

pkgsite program extracts and generates documentation for Go projects.

Example usage:

$ go install
$ cd myproject
$ pkgsite -open .

For more information, see the pkgsite documentation.


Pkgsite requires Go 1.19 to run. The last commit that works with Go 1.18 is 9ffe8b928e4fbd3ff7dcf984254629a47f8b6e63. The last commit that works with Go 1.17 is 4d836c6a652cde92f433967680dfd6171a91ec12.


If you want to report a bug or have a feature suggestion, please first check the known issues to see if your issue is already being discussed. If an issue does not already exist, feel free to file an issue.

For answers to frequently asked questions, see

You can also chat with us on the #pkgsite Slack channel on the Gophers Slack.


We would love your help!

Our canonical Git repository is located at There is a mirror of the repository at

To contribute, please read our contributing guide.


Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.