关于gogs

能够项github一样的创建仓库做团队协助。 对比了几个git-server。 gitlab gogs gitblit这几个工具。 gogs最适合。国人开发功能齐全。最关键的是跨平台。github上开源。golang编写。

工具软件准备

nssm install servername 安装 nssm remove servername 移除 nssm start servername 开启 nssm stop servermame 停止 nssm restart servername 重启 nssm status servername 状态

:: This script relies on nssm.exe to work. :: please, download it and make it available on the system path, :: or copy it to the gogs path. :: https://nssm.cc/download :: This script itself should run in the gogs path, too. :: In case of startup failure, please read carefully the log file. :: Make sure Gogs work running manually with "gogs web" before running :: this script. :: And, please, read carefully the installation docs first: :: http://gogs.io/docs/installation :: To unistall the service, run "nssm remove gogs" and restart windows.

:: Set the folder where you extracted Gogs. Omit the last slash. SET gogspath=C:\Users\Administrator\Desktop\git-server\gogs

nssm install gogs "%gogspath%\gogs.exe" nssm set gogs AppParameters "web" nssm set gogs Description "A painless self-hosted Git service." nssm set gogs DisplayName "Gogs - Go Git Service" nssm set gogs Start SERVICE_DELAYED_AUTO_START nssm set gogs AppStdout "%gogspath%\gogs.log" nssm start gogs pause

```

修改gogspath,这个是gogs解压后的目录(gogs.exe所在目录)。

  1. 管理员身份执行脚本
  2. 脚本提示成功就ok了,如果提示失败。根据提示处理就ok。 无非是nssm remove gogs 重新来一遍。
  3. 执行gogs安装。
  4. http://137.0.0.1:3000 进入后进行一系列的配置。 主要就是数据库和管理员两项配置。 快速使用的话建议使用sqllite。
  5. 打开网址注册一个账号
  6. 添加一个仓库 创建一个个人仓库或者创建组织在组织下添加一个仓库。组织是为了工号的授权管理。
  7. 正常情况下重启电脑后gogs会自动运行。
  8. 经过以上的步骤一个git server算是完成了。gogs的使用帮助 https://gogs.io/
  9. 安装git客户端
  10. 安装msggit
  11. 注意的点就是勾选中windows cmd设置,使用windows的console.
  12. 安装tortoisegit
  13. 注意的点是使用ssh方式选项和几个cmd添加选项。正常情况下安装完成之后就让你填写一个用户名密码。就填写在gogs上注册的用户名和密码。
  14. 使用仓库 先用http的方式吧。git clone http://xxxxxxx (gogs上仓库地址)
  15. 记下来就一些使用的问题。

常见问题

  1. gogs 使用ssh方式clone 主要问题是windows ssh server很不好用。我选择http.
  2. 如何使用ssh https://discuss.gogs.io/t/how-to-config-ssh-settings/34 添加秘钥的时候注意一个点就是里面不能存在换行。

go系统搭建教学(windows下安装gogs)(1)

,