zoukankan      html  css  js  c++  java
  • git远程服务器搭建 debian

    git使用文档:https://git-scm.com/book/zh/v2

    准备:服务器  插入git     命令:apt install git

      客户端:安装git  后打开命令行配置git用户和邮箱命令如下

      $ git config --global user.name "John Doe"
      $ git config --global user.email johndoe@example.com

    一、(服务器)git init --bare /root/git/sample.git 创建仓库
    二    (服务器,为了不输入密码)编辑文件vi /etc/ssh/sshd_config
              松开注释 PubkeyAuthentication yes
                             AuthorizedKeysFile .ssh/authorized_keys
               重启ssh 命令: service sshd restart
    三、(客户端,可做可不做)设置SSH Key

    打开 Git GUI界面有个帮助->show SSH Key菜单,创建密钥.生产密钥位置通常情况下windows在 C盘用户 .ssh文件夹下 
    打开id_rsa.pub文件复制内容 

    (服务器端)在root根目录下 新建.ssh文件夹.新建authorized_keys文件,将id_rsa.pub文件中的内容复制到此处保存.

    四 '克隆
    git clone ssh://用户@服务器地址:端口/root/git/sample.git

      

  • 相关阅读:
    Navicat
    Eclipse 代码质量管理插件
    oracle sql 逻辑处理
    view视图 | 索引
    LIKE模糊查询
    启动tomcat报找不到或无法加载主类
    oracle:decode
    oracle:case when then else end
    ssh 公共秘钥
    ip 和数字之间的转换
  • 原文地址:https://www.cnblogs.com/aibobs/p/10057196.html
Copyright © 2011-2022 走看看