sur*_*190 7 git ignore gitignore
当我运行git status时:
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .gitignore
# modified: .project
# modified: reports/images/2014-03.png
# modified: reports/images/graph-2014-03.bmp
# deleted: reports/phpbmp/cache/0/02/027/0270/phpThumb_cache_portal.gep.co.za_src02707010e1e50bc80594
f31460d514c4_par80d8993b181666aca11d7be02b12fea7_dat1399293161.bmp
# deleted: reports/phpbmp/cache/0/02/027/0270/phpThumb_cache_portal.gep.co.za_src02707010e1e50bc80594
f31460d514c4_par80d8993b181666aca11d7be02b12fea7_dat1399293182.bmp
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# README.MD
# reports/phpbmp/cache/9/
no changes added to commit (use "git add" and/or "git commit -a")
Run Code Online (Sandbox Code Playgroud)
我意识到我不希望跟踪对以下文件的更改:
.project
reports/images/*.png
reports/images/*.bmp
reports/phpbmp/cache/*
Run Code Online (Sandbox Code Playgroud)
所以我添加了这些文件 .gitignore
如何从当前工作目录中删除文件Changes not staged for commit?
Chr*_*aes 30
如果我理解得很好,你想filename进入git存储库.但是,您不希望收到有关新更改的通知filename.您可以使用以下命令执行此操作:
git update-index --assume-unchanged <filename>
Run Code Online (Sandbox Code Playgroud)
如果您想再次开始跟踪更改,请运行以下命令:
git update-index --no-assume-unchanged <filename>
Run Code Online (Sandbox Code Playgroud)
附加信息:编辑.gitignore只会忽略文件,因此不会将它们添加到git存储库中.但是,已经跟踪的文件不会被忽略.
| 归档时间: |
|
| 查看次数: |
5584 次 |
| 最近记录: |