## 查看Git当前的状态
[root@node31 git_test]# git status # On branch master # # Initial commit # nothing to commit (create/copy files and use "git add" to track)

## 创建一个新文件,看一看状态
[root@node31 git_test]# touch chenliang.txt [root@node31 git_test]# ll chenliang.txt -rw-r--r-- 1 root root 0 Feb 19 07:25 chenliang.txt [root@node31 git_test]# [root@node31 git_test]# git status # On branch master # # Initial commit # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # chenliang.txt nothing added to commit but untracked files present (use "git add" to track)

## 让其chenliang.txt文件被git跟踪
[root@node31 git_test]# git add chenliang.txt [root@node31 git_test]# git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: chenliang.txt # [root@node31 git_test]#

来源:https://www.cnblogs.com/chenliangc/p/12329676.html