Git的安装部署


#环境准备  
[root@git ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 
[root@git ~]# uname -r
3.10.0-957.el7.x86_64
[root@git ~]# getenforce 
Disabled
[root@git ~]# iptables-save 
[root@git ~]# date
Mon May 11 11:53:23 CST 2020
[root@git ~]# ll /etc/yum.repos.d/
total 8
-rw-r--r--. 1 root root 2523 2019-05-08 18:36 CentOS-Base.repo
-rw-r--r--. 1 root root  664 2019-05-08 18:36 epel.repo

#安装Git

[root@git ~]# yum install -y git 

#配置部署  

[root@git ~]# git --version
git version 1.8.3.1
[root@git ~]# git config
usage: git config [options]

Config file location
    --global              use global config file			#使用全局配置文件
    --system              use system config file			#使用系统配置文件
    --local               use repository config file		#使用版本库配置文件

#配置git

[root@git ~]# git config  --global   user.name  "qls"			#配置git用户
[root@git ~]# git config  --global   user.email "qls@qq.com"	#配置git邮箱
[root@git ~]# git config  --global   color.ui true				#语法高亮  输出显示颜色 

#检查配置 
[root@git ~]# git config  --list
user.name=qls
user.email=qls@qq.com
color.ui=true
[root@git ~]# cat .gitconfig 
[user]
	name = qls
	email = qls@qq.com
[color]
	ui = true

#git初始化   

#针对一个目录进行初始化  初始化为一个仓库    

[root@git ~]# mkdir git_test
[root@git ~]# ll git_test -d
drwxr-xr-x 2 root root 6 2020-05-11 12:06 git_test
[root@git ~]# cd git_test/
[root@git ~/git_test]# git init 
Initialized empty Git repository in /root/git_test/.git/

#了解 

[root@git ~/git_test]# ll .git/
total 12
drwxr-xr-x 2 root root   6 2020-05-11 12:06 branches		#分支目录 
-rw-r--r-- 1 root root  92 2020-05-11 12:06 config			#项目的配置选项 
-rw-r--r-- 1 root root  73 2020-05-11 12:06 description		#git web程序使用的
-rw-r--r-- 1 root root  23 2020-05-11 12:06 HEAD			#指向当前的分支  指针 
drwxr-xr-x 2 root root 242 2020-05-11 12:06 hooks			#钩子文件
drwxr-xr-x 2 root root  21 2020-05-11 12:06 info			#包含了一个全局排除文件
drwxr-xr-x 4 root root  30 2020-05-11 12:06 objects			#存放所有的数据内容
drwxr-xr-x 4 root root  31 2020-05-11 12:06 refs			#存放指针指向的分支
											index			#默认没有,将代码存在在暂存区时,自动创建,保存暂存区里面的内容 
											
											

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值