10

用Gogs搭建属于自己的Git服务器

 3 years ago
source link: http://server.51cto.com/sOS-644771.htm
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

  fEnQJ3U.jpg!mobile

背景

我们都知道,像码云、GitHub就是一个免费托管开源代码的远程仓库。但是对于公司来说,既不想公开源代码,又舍不得给交保护费,那就只能自己搭建一台Git服务器作为私有仓库使用。

下面介绍下使用gogs搭建属于自己的git服务器。

官网:https://gogs.io/

安装步骤

1、下载git for windows

https://github.com/git-for-windows/git/releases/download/v2.15.0.windows.1/Git-2.15.0-64-bit.exe 

2、下载NSSM:

https://nssm.cc/release/nssm-2.24.zip 

3、下载安装包

https://dl.gogs.io/0.12.3/gogs_0.12.3_windows_amd64.zip 

4、安装git for windows

5、安装NSSM

设置系统变量:"控制面板" --> "系统和安全"--> "系统"--> "高级系统设置"--> "环境变量"--> "系统变量"-->"编辑系统变量"在"变量值"项目添加NSSM文件路径"D:\conanl\Downloads\nssm-2.24\nssm-2.24\win64"。路径安置的实际配置。

6、安装gogs

6.1、编辑系统安装文件:

D:\conanl\Downloads\gogs_0.12.3_windows_amd64\gogs\scripts\windows\install-as-service.bat

修改如下项目:

SETgogspath=D:\conanl\Downloads\gogs_0.12.3_windows_amd64\gogs (按实际安装目录修改)

6.2、以管理权限运行安装脚本:

fAnyAfa.jpg!mobile

YRruAfQ.jpg!mobile

FNZjQb.jpg!mobile

浏览器输入:http://127.0.0.1:3000/

RJjUBn6.jpg!mobile

达到预期效果;接下去就可以注册账号。默认的管理员账号与密码是你注册的第一个账号,就是安装完成后你的第一个账号就是管理员,同时也有普通账号的功能。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK