我已将文件扩展名.patch
添加到我的.gitignore_global
,但尚未在我的本地回购中更新。我想从未跟踪的列表中删除它,但将文件保存在我的本地存储库中。
git status:
Kierans-MacBook-Pro:master-abc kpmacbook$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
0001-adding-column.patch
nothing added to commit but untracked files present (use "git add" to track)
当我尝试运行此命令时:git rm --cached 0001-adding-column.patch
我明白了:
Kierans-MacBook-Pro:master-abc kpmacbook$ git rm --cached 0001-adding-column.patch
fatal: pathspec '0001-adding-column.patch' did not match any files
Kierans-MacBook-Pro:master-abc kpmacbook$
编辑更多信息:
Kierans-MacBook-Pro:master-abc kpmacbook$ git config --get core.excludesfile
~/.gitignore_global
.gitignore_global文件:
Kierans-MacBook-Pro:master-abc kpmacbook$ cat ~/.gitignore_global
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# codekit #
###########
.sass-cache/
.codekit-config.json
config.codekit
# git #
.patch
我该如何解决?
答案 0 :(得分:0)
<强>解决方案:强>
我需要做的就是在我的.gitglobal_ignore
文件中的.patch文件前面添加一个星号......
e.g
# git #
---------------------
*.patch