git+gogs 私服

git for window (v2.10.0)+gogs(自带服务注册)

一、git安装

1、git 版本兼容

服务器环境 window server 2003
对于较老的window系统版本(比如server 2003,xp,vista),相应的git 版本也较低,
比如:vista 支持的最新git版本为: v2.10.1
xp,2003 为 v2.10.0
具体原因参见:

https://superuser.com/questions/1153883/git-for-windows-xp 的一段原文:
Parts of Git are implemented in shell script, and Git for Windows runs those scripts via MSYS2's POSIX emulation layer, which in turn is based on the Cygwin POSIX emulation layer. Seeing as Windows XP and Windows Server 2003 are years past their official end of life, the Cygwin project ended their Herculean efforts to support those Windows versions.

原兼容需求地址 :https://gitforwindows.org/requirements.html

2、下载

window版本 git 下载地址(server 2003系统兼容版本):
https://github.com/git-for-windows/git/releases?after=gitgui-0.21.0

3、安装

二、gogs安装

1、下载gogs

目前最新版本自带服务注册功能,所有可以有2种方式将gogs注册成为window服务

  • 下载gogs软件包时,下载可自身注册的软件包,软件包名称待mws
  • 结合nssm协助注册
2、安装gogs
  • cmd 命令在gogs解压后根目录 输入 gogs web 命令,gogs将启动web服务,端口3000,进行初始化工作

  • 访问 127.0.0.1:3000 进行初始化配置

  • 注册成为服务,gogs 根目录custom\conf\app.ini,修改RUN_USER=计算机名称。获取计算机名称命令为:echo %COMPUTERNAME%

  • 修改[server]节 DOMAIN 和 ROOT_URL 值

  • cmd 命令注册服务
    sc create Gogs start= auto binPath= ""D:\Git\gogs-0.11.91\gogs.exe" web --config "D:\Git\gogs-0.11.91\custom\conf\app.ini""
    sc description Gogs "一款极易搭建的自助 Git 服务,用于驱动团队内部的代码协作。"

posted @ 2021-09-06 11:02  这是个坑  阅读(102)  评论(0编辑  收藏  举报