您好,登錄后才能下訂單哦!
untraked file 未跟蹤的文件,通常為新建立的文件
traked file 通常為建立索引之后的文件
ignored 被忽略的文件,這類型的文件通常在一個文件列表中。維護這個列表的文件在版本庫根目錄名字為 .gitignore
初始化版本庫,保證剛創建狀態
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/
創建文件查看文件類型,發現為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文件語法
#開頭的行用于注釋
空行會被注釋
目錄名末尾用反斜線(/)標記
包含shell通配符,如*。例 debug/32bit/*.o
起始地感嘆號用于取反模式
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。