zoukankan      html  css  js  c++  java
  • git daemon 安装和使用

    git daemon 安装和使用

    系统:Cent OS 8

    安装 git 和 git daemon(不同系统有不同的安装命令)

    yum install -y git

    yum install -y git-daemon

    git daeom 不是 git 命令,git daemon 为用户提供TCP协议,默认使用端口9418

    我们用 /var/lib/git 作为测试目录,其实在安装 git deamon 后,这个目录会自动被创建,当然我们也可以用其它的路径

    git daemon参考链接:https://git-scm.com/book/en/v1/Git-on-the-Server-Git-Daemon

    在 /var/lib/git 中建立一个git remote 仓库:

    参考链接:https://www.cnblogs.com/ibingshan/p/10006946.html

    启动 git daemon 服务

    git daemon --verbose --export-all --base-path=/var/lib/git /var/lib/git

    然后端口会进入交互显示模式:

    [2349] Ready to rumble

    然后在一台客户端电脑使用 git 协议来clone

    git clone git://<server-ip or hostName>/test.git

    可以看出我们不需要给定完整的路径 /var/lib/git/test.git

    这时候在服务器的终端上就会显示一些被客户端连接的信息,我们可以根据这些信息来判断是否读取成功:

    [2349] Ready to rumble
    [2359] Connection from xxx.xxx.xxx.xxx:0000
    [2359] Extended attribute "host": xxxxx
    [2359] Request upload-pack for '/test.git'
    [2349] [2359] Disconnected

    ctrl+c 结束 git damon

    设置 git daemon 开机启动

    参考链接:https://www.cnblogs.com/ibingshan/p/11752148.html

    查看端口被占用的情况

    lsof -i:9418

    显示输出:

    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    git-daemo 3588 root 3u IPv4 60655 0t0 TCP *:git (LISTEN)
    git-daemo 3588 root 4u IPv6 60656 0t0 TCP *:git (LISTEN)

  • 相关阅读:
    GoF23:工厂模式(Factory)
    CSS
    HTML
    JSP基础学习
    JSTL标签
    Jsoup
    Centos7下tomcat关闭异常问题
    剑指Offer_#18_删除链表的节点
    剑指Offer_#17_打印从1到最大的n位数
    剑指Offer_#16_数值的整数次方
  • 原文地址:https://www.cnblogs.com/ibingshan/p/11752352.html
Copyright © 2011-2022 走看看