git只能跟进纯文本文件(文件内部的更改)
word二进制文件 只能跟进大小的变更,不能跟进内容变化
git status -s 无返回表示代码库当前无变更
??表示 刚刚创建的文件,还没提交
A rad.md 暂存区,已经在版本库,但未提交
M 在左边和右边,右边表示未add,左边表示未commit,MM
git commit 只提交所有暂存区的文件,提交成功才真正进入代码库
1.git的安装及使用、
1.git的安装及基本使用
[root@foundation29 ~]# yum install git -y
[root@foundation29 ~]# mkdir demo
[root@foundation29 ~]# cd demo/
[root@foundation29 demo]# ls
[root@foundation29 demo]# git init ##初始化git
Initialized empty Git repository in /root/demo/.git/
[root@foundation29 demo]# l.
. .. .git
[root@foundation29 demo]# cd .git/
[root@foundation29 .git]# ls
branches config description HEAD hooks info objects refs
[root@foundation29 .git]# pwd
/root/demo/.git
[root@foundation29 .git]# cd ..
[root@foundation29 demo]# echo westos > readme.md
[root@foundation29 demo]# ls
readme.md
[root@foundation29 demo]# git status -s
?? readme.md
[root@foundation29 demo]# git status -s
[root@foundation29 demo]# git config --global user.name "Your Name"
[root@foundation29 demo]# git config --global user.email you@example.com ##设置全局变量
[root@foundation29 ~]# cat .gitconfig
[root@foundation29 demo]# vim test.txt
[root@foundation29 demo]# git status -s
?? test.txt
[root@foundation29 demo]# vim readme.md
[root@foundation29 demo]# git status -s
M readme.md
?? test.txt
[root@foundation29 demo]# git add readme.md
[root@foundation29 demo]# git status -s
M readme.md
?? test.txt
[root@foundation29 demo]# vim readme.md
[root@foundation29 demo]# git status -s
MM readme.md
?? test.txt
[root@foundation29 demo]# git add readme.md
[root@foundation29 demo]# git status -s
M readme.md
?? test.txt
[root@foundation29 demo]# git add test.txt
[root@foundation29 demo]# git status -s
M readme.md
A test.txt
[root@foundation29 demo]# git commit -m "add test.
2.让git status -s 忽略指定格式文件
[root@foundation29 demo]# vim .gitignore ##该文件中记录要忽略文件的格式,本例为以.开头的文件
[root@foundation29 demo]# vim .file
[root@foundation29 demo]# git status -s ##已忽略