You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.7 KiB

  1. ---
  2. date: "2016-12-01T16:00:00+02:00"
  3. title: "Hacking on Gitea"
  4. slug: "hacking-on-gitea"
  5. weight: 10
  6. toc: false
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "advanced"
  11. name: "Hacking on Gitea"
  12. weight: 10
  13. identifier: "hacking-on-gitea"
  14. ---
  15. # Hacking on Gitea
  16. Familiarity with the existing [installation instructions](https://golang.org/doc/install)
  17. is required for this section.
  18. To contribute to Gitea, fork the project and work on the `master` branch.
  19. Some internal packages are referenced using their respective Github URL. This can
  20. become problematic. To "trick" the Go tool into thinking this is a clone from the
  21. official repository, download the source code using "go get" and follow these instructions.
  22. ```
  23. go get -d code.gitea.io/gitea
  24. ```
  25. Fork the [Gitea repository](https://github.com/go-gitea/gitea) on GitHub, it should
  26. then be possible to switch the source directory on the command line.
  27. ```
  28. cd $GOPATH/src/code.gitea.io/gitea
  29. ```
  30. To be able to create pull requests, the forked repository should be added as a remote
  31. to the Gitea sources, otherwise changes can't be pushed.
  32. ```
  33. git remote rename origin upstream
  34. git remote add origin git@github.com:<USERNAME>/gitea.git
  35. git fetch --all --prune
  36. ```
  37. This should provide a working development environment for Gitea. Take a look at
  38. the `Makefile` to get an overview about the available tasks. The most common tasks
  39. should be `make test` which will start our test environment and `make build` which
  40. will build a `gitea` binary into the working directory. Writing test cases is not
  41. mandatory to contribute, but it is highly encouraged and helps developers sleep
  42. at night.
  43. That's it! You are ready to hack on Gitea. Test changes, push them to the repository,
  44. and open a pull request.