05.提交一个新文件到git本地仓库

試著忘記壹切 提交于 2020-02-19 08:02:51

## 查看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]#

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!