git安装(一)

1、系统环境准备
查看系统版本
[root@git ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
查看内核版本
[root@git ~]# uname -r
3.10.0-1160.el7.x86_64
确认selinux关闭状态
[root@git ~]# getenforce
Disabled
关闭防火墙
[root@git ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
2、git安装部署

[root@git ~]# yum install git -y 
[root@git ~]# git config
用法:git config [选项]
配置文件位置
   --global              #使用全局配置文件
   --system              #使用系统级配置文件
   --local               #使用版本库级配置文件
[root@git ~]# git config --global user.name  "ajie"  
[root@git ~]# git config --global user.email "ajie@gmail.com"
[root@git ~]# git config --global color.ui
[root@git ~]# git config --list
user.name=ajie
user.email=ajie@gmail.com

3、git初始化
初始化工作目录,对已存在的目录进行初始化

[root@git ~]# mkdir git_data
[root@git ~]# cd git_data/
[root@git git_dada]# git init
Initialized empty Git repository in /root/git_dada/.git/
[root@git git_data]# git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)
posted @ 2021-12-25 14:49  熊孩子Ajie  阅读(43)  评论(0)    收藏  举报