1 使用yum安装Git
sudo yum install git
2 添加git用户
sudo useradd git
3 查看CentOS内核版本,确定架构(x64、x86还是arm)
uname -a
4 下载与其对应的二进制安装包
wget https://dl.gogs.io/0.11.34/linux_amd64.tar.gz
5 将安装包解压至git用户目录下(/home/git)并修改其权限和所有者
sudo tar -xf linux_amd64.tar.gz -C /home/git
sudo chmod -R 700 /home/git/gogs
sudo chown -R git:git /home/git/gogs
6 使用git用户运行gogs
sudo su - git -c "cd /home/git/gogs && ./gogs web &"
7 使用浏览器访问http://IP:3000,完成配置安装
按需求自行配置
8 添加启动项和守护进程
sudo ln -sf /home/git/gogs/scripts/systemd/gogs.service /usr/lib/systemd/
sudo chmod u+x /home/git/gogs/scripts/systemd/gogs.service
sudo ln -sf /home/git/gogs/scripts/init/centos/gogs /etc/init.d/
sudo chmod u+x /home/git/gogs/scripts/init/centos/gogs
sudo /sbin/chkconfig gogs on
sudo service gogs restart
参数配置
vi /home/git/gogs/custom/conf/app.ini
eclipse Git插件安装或更新
打开Eclipse,然后点击Help>Install New Software>Add
- Name:EGit
- Location: http://download.eclipse.org/egit/updates
网友评论