加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xcode – gitignore不忽略文件

发布时间:2020-12-15 01:44:58 所属栏目:百科 来源:网络整理
导读:无论我放入什么.gitignore我都不能让git忽略下面的UserInterfaceState.xcuserstate文件: $git statusOn branch masterYour branch is up-to-date with 'origin/master'.Changes not staged for commit: (use "git add file..." to update what will be comm
无论我放入什么.gitignore我都不能让git忽略下面的UserInterfaceState.xcuserstate文件:

$git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   .gitignore
    modified:  CalFoo.xcodeproj/project.xcworkspace/xcuserdata/wcochran.xcuserdatad/UserInterfaceState.xcuserstate

我正在使用/编辑this post上列出的.gitignore文件.
我尝试了一切以匹配模式,包括确切的路径名:CalFoo.xcodeproj / project.xcworkspace / xcuserdata / wcochran.xcuserdatad / UserInterfaceState.xcuserstate无济于事.

这个特殊问题源于工作流,其中Xcode用于创建初始git repo,之后添加了here的.gitignore文件.从this question可以找到忽略git中先前跟踪的文件的更一般的答案(我想我在搜索中从未发现过这篇文章,因为标题中没有“gitignore”).

解决方法

您只能忽略未版本控制的文件,但git已知该文件.

如果你想让git跟踪那个文件,就没有必要告诉git忽略它.

如果您不希望git跟踪该文件,请使用git rm,您的ignore规则将开始工作.

警告:git rm将删除该文件.使用git rm –cached从repo中删除但不从磁盘中删除.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读