git客户端初始化

安装git客户端:
[root@super67 ~]# yum install -y git

配置git信息:
[root@super67 ~]# git config --global user.name "xiaofan"
[root@super67 ~]# git config --global user.email "750657961@qq.com"
[root@super67 ~]# 
[root@super67 ~]# git config --list
user.name=xiaofan
user.email=750657961@qq.com


创建git目录:
[root@super67 ~]# mkdir xiaofan
[root@super67 ~]# cd xiaofan/
[root@super67 xiaofan]# git init
Initialized empty Git repository in /root/xiaofan/.git/


[root@super67 xiaofan]# ls
[root@super67 xiaofan]# ll -a
total 12
drwxr-xr-x 3 root root 4096 Sep 25 11:33 .
dr-xr-x---. 30 root root 4096 Sep 25 11:33 ..
drwxr-xr-x 7 root root 4096 Sep 25 11:33 .git
[root@super67 xiaofan]# vim one.txt
[root@super67 xiaofan]# cat one.txt 
1 haha


查看状态:
[root@super67 xiaofan]# git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# one.txt
nothing added to commit but untracked files present (use "git add" to track)


提交:
[root@super67 xiaofan]# git commit -m "the first commit"
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# one.txt
nothing added to commit but untracked files present (use "git add" to track)

原文地址:https://www.cnblogs.com/fanxuanhui-linux/p/5906055.html