git文件管理心得分享
untraked file 未跟蹤的文件,通常為新建立的文件
traked file 通常為建立索引之后的文件
ignored 被忽略的文件,這類型的文件通常在一個(gè)文件列表中。維護(hù)這個(gè)列表的文件在版本庫根目錄名字為 .gitignore
初始化版本庫,保證剛創(chuàng)建狀態(tài)
huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo (master) $ ls hello huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo (master) $ ls -a ./ ../ .git/ hello huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo (master) $ rm -rf .git/ hello huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo $ git init Initialized empty Git repository in C:/Users/huawei/Desktop/git-repo/.git/
創(chuàng)建文件查看文件類型,發(fā)現(xiàn)為untraked file未被跟蹤的文件
huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo (master) $ echo "hello world" > hello huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo (master) $ git status On branch master No commits yet Untracked files: (use "git add <file>..." to include in what will be committed) hello nothing added to commit but untracked files present (use "git add" to track)
被跟蹤的文件通常為建立索引之后的文件,可以通過git ls-files -s查看。至于被忽略的文件可以看下面的演示,將文件名寫入到.gitignore文件即可
huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo (master) $ git status On branch master nothing to commit, working tree clean huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo (master) $ echo "a" > a huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo (master) $ git status On branch master Untracked files: (use "git add <file>..." to include in what will be committed) a nothing added to commit but untracked files present (use "git add" to track) huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo (master) $ echo a >> .gitignore huawei@DESKTOP-JTC012C MINGW64 ~/Desktop/git-repo (master) $ git status On branch master Untracked files: (use "git add <file>..." to include in what will be committed) .gitignore nothing added to commit but untracked files present (use "git add" to track)
.gitignore文件語法
#開頭的行用于注釋
空行會被注釋
目錄名末尾用反斜線(/)標(biāo)記
包含shell通配符,如*。例 debug/32bit/*.o
起始地感嘆號用于取反模式
相關(guān)文章
Linux netfilter/iptables知識點(diǎn)詳解
在本篇文章里小編給大家整理的是關(guān)于Linux netfilter/iptables知識點(diǎn)詳解,有興趣的朋友們可以參考下。2020-03-03Nginx啟動SSL功能,并進(jìn)行功能優(yōu)化詳細(xì)介紹
這篇文章主要介紹了Nginx啟動SSL功能,并進(jìn)行功能優(yōu)化詳細(xì)介紹的相關(guān)資料,需要的朋友可以參考下2016-12-12apache與iis下讓html格式的頁面也同樣具有shtml的動態(tài)解析
apache下讓html格式的頁面也同樣具有shtml的動態(tài)解析,方便有此需要的朋友。2011-03-03