git服务器搭建
来源:互联网 发布:c语言10的n次方 编辑:程序博客网 时间:2024/06/01 07:20
服务端
yum install git git-core ssh;
useradd git
passwd git //设置密码
cd /home/git
mkdir .ssh // 700 权限给
chmod 700 .ssh
chown -R git:git .ssh
cd .ssh
touch authorized_keys
chmod 644 authorized_keys
cd /srv/
mkdir opt
cd opt
git init --bare laravelblog.git
chown -R git:git laravelblog.git/
客户端
安装好git
我这里是 ubuntu ,还有我的用户名叫 maozhongyu
apt-get install git
ssh-keygen -t rsa /生成 私秘 和 公秘
cd /home/maozhongyu/.ssh
ls -al
drwx------ 2 maozhongyu maozhongyu 4096 8月 29 14:51 .
drwxr-xr-x 35 maozhongyu maozhongyu 4096 8月 29 15:02 ..
-rw------- 1 maozhongyu maozhongyu 1679 8月 29 14:27 id_rsa
-rw-r--r-- 1 maozhongyu maozhongyu 408 8月 29 14:27 id_rsa.pub
-rw-r--r-- 1 maozhongyu maozhongyu 9954 8月 29 13:52 known_hosts
把id_rsa.pub 里面的内容 复制到 远程服务器的 /home/git/.ssh/authorized_keys 里.
那么大致就搭建完毕了
git clone git@198.44.171.25:/srv/opt/laravelblog.git
- Git服务器 - 搭建git
- Git 搭建Git服务器
- Git之搭建Git服务器
- git教程 搭建GIT服务器
- 自定义Git - 搭建Git服务器
- git服务器搭建
- git服务器搭建
- git服务器搭建
- git服务器搭建过程
- git服务器的搭建
- git服务器的搭建
- git服务器搭建
- git服务器搭建过程
- git服务器的搭建
- 搭建git服务器
- ubuntu搭建Git 服务器
- Git服务器搭建
- git服务器的搭建
- TabLayout切换选项背景和修改字体大小
- 第7章 Linux文件与目录管理---7.1
- 【Android问题】解决 Android SDK下载和更新失败“Connection to https://dl-ssl.google.com refused”的问题
- boost之路 六 多线程
- Docker常见问题
- git服务器搭建
- iOS集成微信支付
- 计算机网络学习笔记
- GPS数据包解析
- 乐谱
- 机器学习中的判别模型和生成模型
- 视频目标跟踪算法
- boost之路 七 异步输入输出
- 遇到的App上传到App Store时报错的疑难杂症(一)——ipa包中的Info.plist文件中没有CFBundleVersion的key