我想直接從git外殼添加一個特定的文件到.gitignore。文件無法忽略的是token.mat
直接從git外殼添加文件到.gitignore
如果鍵入:
touch .gitignore
,然後手動開啓的.gitignore用文本編輯器,並添加
token.mat
保存並關閉,它的工作原理,混帳忽略它(當我在git shell中輸入git status時,我不再看到token.mat)
但是,在git shell中,如果我鍵入:
touch .gitignore
echo 'token.mat' >> .gitignore
然後git不會忽略token.mat,當我輸入git status時,我仍然可以看到它。但是,當我打開帶文本編輯的.gitignore時,我看到了列出的token.mat,看起來和我手動添加時完全一樣。
有沒有人知道這是爲什麼,或者我可以直接從git外殼添加文件到.gitignore?
感謝您提前提供任何幫助!
其他詳情:
- Windows 7專業版,Service Pack 1的
- Git版本:2.5.3.windows.1
- 文本編輯器:記事本++
文本編輯器處理文件的添加/處理索引到git項目嗎? – hjpotter92