安装git客户端:
[[email protected] ~]# yum install -y git
配置git信息:
[[email protected] ~]# git config --global user.name "xiaofan"
[[email protected] ~]# git config --global user.email "[email protected]"
[[email protected] ~]#
[[email protected] ~]# git config --list
user.name=xiaofan
[email protected]
创建git目录:
[[email protected] ~]# mkdir xiaofan
[[email protected] ~]# cd xiaofan/
[[email protected] xiaofan]# git init
Initialized empty Git repository in /root/xiaofan/.git/
[[email protected] xiaofan]# ls
[[email protected] 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
[[email protected] xiaofan]# vim one.txt
[[email protected] xiaofan]# cat one.txt
1 haha
查看状态:
[[email protected] 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)
提交:
[[email protected] 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)