21.git 服务器端安装 centos yum
21.1安装服务器端
yum install -y git git --version 查看安装
21.2安装客户端
下载 Git for Windows,地址:https://git-for-windows.github.io/
git --version
21.3 创建 git 用户
[root@localhost home]# id git [root@localhost home]# useradd git [root@localhost home]# passwd git
21.4服务器端创建 Git 仓库
设置 /home/data/git/gittest.git 为 Git 仓库 然后把 Git 仓库的 owner 修改为 git [root@localhost home]# mkdir -p data/git/gittest.git [root@localhost home]# git init --bare data/git/gittest.git Initialized empty Git repository in /home/data/git/gittest.git/ [root@localhost home]# cd data/git/ [root@localhost git]# chown -R git:git gittest.git/
21.5客户端 clone 远程仓库
进入 Git Bash 命令行客户端,创建项目地址(设置在 I:\gitrespository)并进入
git clone git@172.23.27.113:/home/data/git/gittest.git
The authenticity of host '192.168.56.101 (192.168.56.101)' can't be established. RSA key fingerprint is SHA256:Ve6WV/SCA059EqoUOzbFoZdfmMh3B259nigfmvdadqQ. Are you sure you want to continue connecting (yes/no)? 选择 yes: Warning: Permanently added '192.168.56.101' (RSA) to the list of known hosts.
ssh-keygen -t rsa -C "curiousby@163.com"
21.6服务器端 Git 打开 RSA 认证
进入 /etc/ssh 目录,编辑 sshd_config,打开以下三个配置的注释:
RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys 保存并重启 sshd 服务: [root@localhost ssh]# /etc/rc.d/init.d/sshd restart
[root@localhost git]#pwd /home/git [root@localhost git]# mkdir .ssh [root@localhost git]# chown -R git:git .ssh [root@localhost git]# ll -a 总用量 32 drwx------. 5 git git 4096 8月 28 20:04 . drwxr-xr-x. 8 root root 4096 8月 28 19:32 .. -rw-r--r--. 1 git git 18 10月 16 2014 .bash_logout -rw-r--r--. 1 git git 176 10月 16 2014 .bash_profile -rw-r--r--. 1 git git 124 10月 16 2014 .bashrc drwxr-xr-x. 2 git git 4096 11月 12 2010 .gnome2 drwxr-xr-x. 4 git git 4096 5月 8 12:22 .mozilla drwxr-xr-x. 2 git git 4096 8月 28 20:08 .ssh
21.7将客户端公钥导入服务器端
/home/git/.ssh/authorized_keys 文件
回到 Git Bash 下,导入文件:
$ ssh git@192.168.56.101 'cat >> .ssh/authorized_keys' < ~/.ssh/id_rsa.pub
需要输入服务器端 git 用户的密码
21.8回到服务器端,查看 .ssh 下是否存在 authorized_keys 文件
修改 .ssh 目录的权限为 700 修改 .ssh/authorized_keys 文件的权限为 600
[root@localhost git]# chmod 700 .ssh [root@localhost git]# cd .ssh [root@localhost .ssh]# chmod 600 authorized_keys
21.9客户端再次 clone 远程仓库
git clone git@172.23.27.113:/home/data/git/gittest.git
21.10 测试上传 到git
捐助开发者
在兴趣的驱动下,写一个免费
的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。
谢谢您的赞助,我会做的更好!
相关推荐
添加新源后安装新版(软件包 git2u 已经被 git216 取代) yum install -y https://centos7.iuscommunity.org/ius-release.rpm yum install -y git216 检验 git version ————————————————————- ...
centos/redhat7.x离线安装git,包含整套依赖包以及安装说明文档,如果安装出现yum未注册,请下载本主 Redhat7.6离线替换yum源为网易源 资源包。 centos/redhat7.x离线安装git,包含整套依赖包以及安装说明文档,如果...
Linux 做为服务器端系统,Windows 作为客户端系统,分别安装 Git 服务器端: #yum install -y git 安装完后,查看 Git 版本 [root@localhost ~]# git --version git version 1.7.1 客户端: 下载 Git for Windows...
1、首先需要安装Git,可以使用yum源在线安装: [root@localhost Desktop]# yum install -y git 2、创建一个git用户,用来运行git服务 # adduser git 3、初始化git仓库:这里我们选择/data/git/learngit.git来...
centos通过yum安装git [lidengyin@ldy ~]$ sudo yum install -y git centos通过yum卸载git yum remove git 初次运行配置 安装完git之后,第一件事就是设置用户名称与邮件地址。这样很重要。因为每个git的提交都会...
前言 我们可以GitHub发布...这里也已经安装过了,如果没有安装可以用yum install git 安装。 二 创建git用户 这里你可以选择新建一个用户来测试,也可以直接使用你的root进行以下操作。笔者也是看着资料一步一步来的
CentOS6.5自带的git版本是1.7.1 卸载自带的git # yum remove git 下载最新版git # wget https://github.com/git/git/archive/v2.9.2.tar.gz 解压 # tar zxvf v2.9.2.tar.gz # cd git-2.9.2 编译安装 # make ...
yum install git yum install gcc yum install openssl-devel yum install sqlite yum install sqlite-devel yum install libevent yum install libevent-devel yum install postgresql-devel yum install ...
安装最新版本git sudo yum remove git sudo yum install epel-release sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm sudo yum install git2u 验证git版本 git --version 安装 Ngrok ...
虚拟机为centos7系统,svn服务器安装在centos7系统平台上,svn客户端分别在windows7和centos7系统上使用; 1、安装svn服务器: ]# yum install subversion 2、配置svn服务器: 建立svn版本库根目录及相关目录即...
众所周知,版本系统在开发环境中是必不可少的,但是我们可以把代码免费的托管到GitHub上,如果我们...Linux是服务器端系统,Windows作为客户端系统,分别安装Git 安装服务端: [root@linuxprobe ~]# yum install -y g
1.安装前执行命令: yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc yum install gcc perl-ExtUtils-MakeMaker 2.用wget命令下载到linux上: wget ...
git clone git://github.com/phalcon/cphalcon.git #需要安装安装git软件包yum install git cd /usr/local/src/cphalcon/build/php5/64bits #选择相应的php版本目录 /usr/local/php/bin/phpize ./configure –with-...
在CentOS中,要查询使用yum中具安装的软件包具体的安装位置,可以使用yum -ql <软件包名>的方式进行查询。 比如,我想查询git的一个组件git-http-backend的安装位置,可以使用如下命令实现 rpm -ql git | grep ...
令人敬畏的镜子:为墙后的开发者提供的镜子。 这些是镜像,包括但不限于Docker,Nodejs,Python,Java,Goproxy,Ruby,Alpine apk,Centos yum,Debian apt,Ubuntu apt,Homebrew,iOS,Git
sudo yum -y install git git clone https://github.com/jnaqsh/ffmpeg_installer/ cd ffmpeg_installer chmod +x ./ * .sh sudo ./ff_installer.sh 解除安装 cd ~ /ffmpeg_installer sudo ./ff_uninstaller.sh 执照...
搭建Git服务器需要准备一台运行Linux的机器,在此我们使用CentOS。以下为安装步骤: 1.下载git-2.22.0.tar.gz https://Github.com/Git/Git/archive/v2.22.0.tar.gz 使用Xftp 把安装包放到服务器上 2、安装git服务...
处于安全考虑,在内网搭建一套,有图形界面,可以直接从外网git导入进来,使用了一下觉得挺方便,把安装流程记录下来,参考官网:https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/install/centos 可以...
括号Git Brackets-Git是编辑器的扩展-它为Brackets提供了Git集成。 它已经过测试,并且可以在...RedHat / CentOS / Fedora: sudo yum install git 扩展安装: 要安装最新版本的Brackets-Git,请使用内置的Bracket
GlusterFS REST API server安装使用(centos7) 一.REST API server安装 1.下载 $ git clone https://github.com/aravindavk/glusterfs-rest.git 2.安装依赖包 yum install python-dev yum install python-...