windows下安装gogs

关于gogs

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

工具软件准备

服务端搭建

nssm工具

nssm工具目录添加环境变量。其主要的命令如下:

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

具体的使用方法:http://nssm.cc/usage

安装gogs

  1. 编辑运行脚本
    脚本如下: script/window/install-as-service.bat
@ECHO off

:: 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所在目录)。
2. 管理员身份执行脚本
脚本提示成功就ok了,如果提示失败。根据提示处理就ok。
无非是nssm remove gogs 重新来一遍。
3. 执行gogs安装。
http://137.0.0.1:3000 进入后进行一系列的配置。
主要就是数据库和管理员两项配置。 快速使用的话建议使用sqllite。
4. 打开网址注册一个账号
5. 添加一个仓库
创建一个个人仓库或者创建组织在组织下添加一个仓库。组织是为了工号的授权管理。
6. 正常情况下重启电脑后gogs会自动运行。
经过以上的步骤一个git server算是完成了。gogs的使用帮助 https://gogs.io/

安装git客户端

  1. 安装msggit
    注意的点就是勾选中windows cmd设置,使用windows的console.
  2. 安装tortoisegit
    注意的点是使用ssh方式选项和几个cmd添加选项。正常情况下安装完成之后就让你填写一个用户名密码。就填写在gogs上注册的用户名和密码。
  3. 使用仓库
    先用http的方式吧。git clone http://xxxxxxx (gogs上仓库地址)
  4. 记下来就一些使用的问题。

常见问题

  1. gogs 使用ssh方式clone
    主要问题是windows ssh server很不好用。我选择http.
  2. 如何使用ssh
    https://discuss.gogs.io/t/how-to-config-ssh-settings/34
    添加秘钥的时候注意一个点就是里面不能存在换行。
  • 3
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值