linux centos git server 简易搭建

Posted wswind

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux centos git server 简易搭建相关的知识,希望对你有一定的参考价值。

dnf install git -y

id it
useradd git

su git
cd
mkdir .ssh && chmod 700 .ssh
touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
cat /tmp/id_rsa.john.pub >> ~/.ssh/authorized_keys

mkdir -p /opt/git/repo.git
git init --bare /opt/git/repo.git
chown -R git:git /opt/git


cat /etc/shells # see if `git-shell` is already in there. If not...
which git-shell # make sure git-shell is installed on your system.
vim /etc/shells # and add the path to git-shell from last command
chsh git # and enter the path to git-shell, usually: /usr/bin/gitshell


git clone [email protected]:/opt/git/repo.git

https://www.cnblogs.com/dee0912/p/5815267.html
https://git-scm.com/book/zh/v2 - 服务器上的git


以上是关于linux centos git server 简易搭建的主要内容,如果未能解决你的问题,请参考以下文章

centos 7 配置git server 详解

Welcome to CentOS Git server

Welcome to CentOS Git server

git - 搭建最简单的git server

Linux命令简版

linux学习之centos:git的安装