Skip to content

Commit a926994

Browse files
authored
Re-add accidentally removed hacking-on-gitea.zh-cn.md (#23297) (#23305)
1 parent 8390353 commit a926994

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
date: "2016-12-01T16:00:00+02:00"
3+
title: "加入 Gitea 开源"
4+
slug: "hacking-on-gitea"
5+
weight: 10
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "developers"
11+
name: "加入 Gitea 开源"
12+
weight: 10
13+
identifier: "hacking-on-gitea"
14+
---
15+
16+
# Hacking on Gitea
17+
18+
首先你需要一些运行环境,这和 [从源代码安装]({{< relref "doc/installation/from-source.zh-cn.md" >}}) 相同,如果你还没有设置好,可以先阅读那个章节。
19+
20+
如果你想为 Gitea 贡献代码,你需要 Fork 这个项目并且以 `master` 为开发分支。Gitea 使用 Govendor
21+
来管理依赖,因此所有依赖项都被工具自动 copy 在 vendor 子目录下。用下面的命令来下载源码:
22+
23+
```
24+
go get -d code.gitea.io/gitea
25+
```
26+
27+
然后你可以在 Github 上 fork [Gitea 项目](https://github.com/go-gitea/gitea),之后可以通过下面的命令进入源码目录:
28+
29+
```
30+
cd $GOPATH/src/code.gitea.io/gitea
31+
```
32+
33+
要创建 pull requests 你还需要在源码中新增一个 remote 指向你 Fork 的地址,直接推送到 origin 的话会告诉你没有写权限:
34+
35+
```
36+
git remote rename origin upstream
37+
git remote add origin git@github.com:<USERNAME>/gitea.git
38+
git fetch --all --prune
39+
```
40+
41+
然后你就可以开始开发了。你可以看一下 `Makefile` 的内容。`make test` 可以运行测试程序, `make build` 将生成一个 `gitea` 可运行文件在根目录。如果你的提交比较复杂,尽量多写一些单元测试代码。
42+
43+
好了,到这里你已经设置好了所有的开发 Gitea 所需的环境。欢迎成为 Gitea 的 Contributor。

0 commit comments

Comments
 (0)