wpg234g4uz 发表于 2016-4-19 10:27:07

Ubuntu 安装git服务器

安装git服务器
  sudoapt-getinstallgit-core
配置git服务器
  1.创建git服务器管理用户
  sudouseradd-mgit
  sudopasswdgit
  2.创建git仓库存储目录
  sudomkdir/home/git/repositories
  3.设置git仓库权限
  sudochowngit:git/home/git/repositories
  sudochmod755/home/git/repositories
  4.初始化全局设置
  gitconfig--globaluser.name"myname"
  gitconfig--globaluser.email"myname@server"
安装git-daemon
  sudoapt-getinstallgit-daemon-run
配置git-daemon
  vi/etc/service/git-daemon/run
  #!/bin/sh
  exec2>&1
  echo'git-daemonstarting.'
  execchpst-ugitdaemon\
  "$(git--exec-path)"/git-daemon--enable=receive-pack--verbose--export-all--base-path=/home/apuser/repositoryies
查询git-daemon进程信息
  ps-eaf|grep-vgrep|grepgit
查看git-daemon监听端口信息
  sudolsof-i:9418
启动停止git-daemon服务
  sudosvdowngit-daemon
  Sudosvupgit-daemon
页: [1]
查看完整版本: Ubuntu 安装git服务器