diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index f543d53..0298d4f 100755 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -75,11 +75,20 @@ module.exports = { }, { text: '资源', - link: '/resource/', + link: '/resource/' }, { text: '社区', - link: '/community/', + items: [ + { + text: '贡献代码', + link: '/community/contrib.html' + }, + { + text: '报告Bug', + link: '/community/bugreport.html' + }, + ] }, { text: '关于', diff --git a/docs/.vuepress/public/images/workflow.png b/docs/.vuepress/public/images/workflow.png new file mode 100644 index 0000000..224c19f Binary files /dev/null and b/docs/.vuepress/public/images/workflow.png differ diff --git a/docs/community/bugreport.md b/docs/community/bugreport.md new file mode 100644 index 0000000..0df2c3a --- /dev/null +++ b/docs/community/bugreport.md @@ -0,0 +1,20 @@ +# 报告Bug + +如果您发现了一个Bug,我们欢迎您将之告知我们,帮助我们将XiUOS变得更好 + +您可以访问XiUOS在Trustie平台的项目首页 +[https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos), +点击 "+任务"按钮报告Bug。 + +或者直接[点击这里]( https://forgeplus.trustie.net/projects/xuos/xiuos/issues/new) + +必填的内容有: + +- 标题:请简洁描述该bug,如"无法从xx接口读取xx设备的数据" + +- 描述:请详细描述该bug在什么环境, 什么条件, 如何发生的, 发生时的系统行为 +等信息, 以帮助开发人员及时准确定位错误并修复。 + +- 类型:请选择为 "缺陷"。 + +- 状态:请选择为 "新增"。 diff --git a/docs/community/contrib.md b/docs/community/contrib.md new file mode 100644 index 0000000..10ef776 --- /dev/null +++ b/docs/community/contrib.md @@ -0,0 +1,147 @@ +# 为 XiUOS 贡献代码 + +热烈欢迎您加入XiUOS开发者社区,贡献您的力量。 + +XiUOS采用git作为代码仓库,开发流程如下图所示: + +![git workflow](/images/workflow.png) + + +这里假定您对git已经有了一定的了解。 + +XiUOS的主代码库地址为 "https://git.trustie.net/xuos/xiuos.git" + +XiUOS的项目首页为 +[https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos) + + + +## 准备阶段 + +首先, 从XiUOS主库中复刻一份到自己的个人空间。 + +假定您在Trustie的用户名为 "panda" + +### 步骤1 : 复刻 + +在浏览器中打开 XiUOS的项目首页 [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos), 点击右上角的"复刻" 按钮 + + +这样您就在自己的个人空间中有了XiUOS的一个复刻代码库, 地址为 + +项目首页为 "https://forgeplus.trustie.net/projects/panda/xiuos" + +代码库地址为 "https://git.trustie.net/panda/xiuos.git" + +### 步骤2 : 下载到本地,并配置 + +* 从个人空间下载 + +``` +git clone https://git.trustie.net/panda/xiuos.git +``` + +::: warning 警告 +请务必记住,将panda替换为您自己的用户名 +::: + +* 配置 + +``` +# 设置 upstream +git remote add upstream https://git.trustie.net/xuos/xiuos.git +# 禁止直接向 upstream 推送代码 +git remote set-url --push upstream no_push +``` + +## 工作阶段 + +### 步骤3 : fetch + +从 **upstream(xuos/xiuos)** fetch 代码到本地 + +``` +git fetch upstream +``` + +### 步骤4 : branch + +为本次工作创建一个分支,命名为 `develop` + +``` +git checkout -b develop upstream/master +``` + +### 步骤5 : work, commit & commit + +此时就可以在该分支下工作了, 不断修改代码,不断 commit + +``` +git add . + +git commit -m "your commit message" +``` + +### 步骤6 : push & push + +如果经过测试,您觉得在本地完成了代码工作,您就可以将代码推送到您自己的服 +务器端的仓库中了。 + +``` +git push origin develop +``` + +push到自己的服务器端库中后,就可以准备创建`合并请求(Pull Request)`了。 + +### 步骤7 : fetch + +从XiUOS的主库, 即 upstream 中, fetch 最新的代码 + +``` +git fetch upstream +``` + +### 步骤8 : merge + +将upstream 上最新的代码合并到你的当前工作分支 + +``` +git merge upstream/master +``` + +此时请确保本地您位于工作分支。如果合并过程有冲突,您要负责解决冲突,并提交。 + +### 步骤9 : push + +将消解了冲突的最新本地代码,推送到个人服务器端仓库的develop分支。 + +``` +git push origin develop +``` + +### 步骤10 : 合并请求(pull request) + +到自己个人服务器端仓库的首页 https://forgeplus.trustie.net/projects/panda/xiuos, 点击 **合并请求** , + +设置源分支: + +选择 设定的工作分支, 本文的例子是 **develop** 分支 + +设置目标分支: + +目标仓库选择 upstream 库, 即: "泛在操作系统实验室/xiuos" + +目标分支选择 `master` + +提交即可。 + +如果您的"合并请求"被核心开发者拒绝, 这种情况在开源社区很常见,所以请不要灰心失望, 请按照返回的意见修改完善,再提交即可。 + +### 更新本地和个人服务器端仓库的主分支 + +``` +git fetch upstream +git checkout master +git merge upstream/master +git push origin master +```