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

      

  • 相关阅读:
    toj4119HDFS
    hdu2952Counting Sheep
    hdu2393Higher Math
    hdu2317Nasty Hacks
    hdu2309ICPC Score Totalizer Software
    hdu2304Electrical Outlets
    hdu2399GPA
    一、 软件测试概述
    JQuery选择器大全
    如何避免jQuery库和其他库的冲突
  • 原文地址:https://www.cnblogs.com/aibobs/p/10057196.html
Copyright © 2011-2022 走看看