linux下git的配置
2016-09-18 10:43
344 查看
1.安装好linux,安装好git(192.168.1.239) 2.创建一个用户zph(让此用户提供git on server),密码设置为12345678 # useradd zph # passwd zph 3.切换到zph用户 # su zph $ cd 4.创建一个远程仓库 $ git init --bare sample.git 5.在windows下(192.168.1.5),打开git bash 克隆一个仓库,输入以下命令 $ git clone zph@192.168.1.239:/home/zph/sample.git 终端会让输入密码,此时输入zph用户的密码即(12345678)6.为了让用户,不用每次都输入密码,在linux生成.ssh目录 $ ssh-keygen -t rsa -C "youremail@example.com" 7.进入.ssh,新建一个authorized_keys文件 $ cd /home/zph/.ssh/ $ vi authorized_keys 8.打开windows中当前用户的 .ssh/id_rsa.pub 复制里面的内容,粘贴到第7步中的authorized_keys中,切记要使用插入模式 9.更改authorized_keys文件的权限 $chmod 600 authorized_keys 10.验证authorized_keys有没有生效,打开windows $ ssh zph@192.168.1.239 如果不需要输入密码,代表生效了 linux上边想要不输入密码那就把linux上的key也复制到authorized_keys 在linux上克隆一个本地仓库: $ git clone zph@192.168.1.239:/home/zph/sample.git 终端会让输入密码,此时输入zph用户的密码即(12345678) 11.重复第5步,已经不需要输入密码了 12.代码自动更新 cp /home/zph/sample.git/hooks/post-update.sample /home/zph/sample.git/hooks/post-update 13.打开post-update,先清空内容,然后进行编辑如下 cd /usr/share/nginx/html/sample unset GIT_DIR git checkout master git pull
相关文章推荐
- Linux下安装配置git
- git 的简单使用(linux)含ssh配置
- git send-mail发送patches配置(linux环境,使用Gmail)
- linux git安装和配置
- Linux下git的基本配置与用法
- git在linux上的安装配置包括设置不同用户的权限
- linux : gerrit搭建配置服务器+git简单操作+apache代理配置+部分遇到的错误及处理
- 在Linux下使用gitosis配置安装Git服务器
- Linux环境下的Git服务器配置
- linux git 配置。
- git入门-linux下配置git
- git在linux上的安装配置包括设置不同用户的权限
- git在windows和linux下的配置
- Linux下配置git/github
- win与linux下git配置p4merge为合并比较工具的方法【转】
- linux 中关于git diff的配置
- linux搭建配置以及恢复git服务器
- git 的使用-linux上的配置 -ssh
- Linux下git安装配置
- git学习一 基于linux ubuntu git安装与配置