gpt4 book ai didi

git - 如何使用 git 忽略对跟踪文件的新更改?

转载 作者:太空狗 更新时间:2023-10-29 12:55:52 24 4
gpt4 key购买 nike

<分区>

当我运行 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")

我意识到我不想跟踪对以下文件的更改:

.project
reports/images/*.png
reports/images/*.bmp
reports/phpbmp/cache/*

所以我将这些文件添加到.gitignore

如何从 Changes not staged for commit 下的当前工作目录中删除文件?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com