gitignore 不忽略 opencv2.framework
gitignore not ignoring opencv2.framework
我试图让 git 忽略我导入到我的项目中的 opencv2.framework。但是,即使我将 opencv2.framework 添加到我的 .gitignore 中,每次我在终端上显示 运行 git 状态时,所有 opencv2.framework 文件都会显示作为新文件。有人可以帮忙吗?谢谢!这就是我的 .gitignore 文件的样子:(我在 ##Various Settings 下写了 opencv2.framework)
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
opencv2.framework/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
以防万一,查看 git 状态是否在以下时间发生变化:
cd /path/to/my/repo
git rm -r --cached opencv2.framework/
如果确实如此(并且您再也看不到 opencv2.framework/
个文件),请提交您的当前状态。
您需要执行 git rm -r --cached
:
- 在要删除的文件夹的父存储库中(
opencv2.framework/
的父级)。
添加并提交(并最终推送),以便从 git 存储库(但不是从磁盘,感谢 --cached
选项)记录删除;
- 为了删除那些已跟踪文件,因为
.gitignore
规则仅适用于未跟踪文件。
我试图让 git 忽略我导入到我的项目中的 opencv2.framework。但是,即使我将 opencv2.framework 添加到我的 .gitignore 中,每次我在终端上显示 运行 git 状态时,所有 opencv2.framework 文件都会显示作为新文件。有人可以帮忙吗?谢谢!这就是我的 .gitignore 文件的样子:(我在 ##Various Settings 下写了 opencv2.framework)
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
opencv2.framework/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
以防万一,查看 git 状态是否在以下时间发生变化:
cd /path/to/my/repo
git rm -r --cached opencv2.framework/
如果确实如此(并且您再也看不到 opencv2.framework/
个文件),请提交您的当前状态。
您需要执行 git rm -r --cached
:
- 在要删除的文件夹的父存储库中(
opencv2.framework/
的父级)。
添加并提交(并最终推送),以便从 git 存储库(但不是从磁盘,感谢--cached
选项)记录删除; - 为了删除那些已跟踪文件,因为
.gitignore
规则仅适用于未跟踪文件。