2017-06-30 5 views
1

私はプロジェクトにインポートしたopencv2.frameworkをgitで無視しようとしています。しかし、自分の.gitignoreにopencv2.frameworkを追加しているにもかかわらず、自分の端末でgitステータスを実行するたびに、すべてのopencv2.frameworkファイルが新しいファイルとして表示されます。誰も助けてくれますか?ありがとう!これは私の.gitignoreファイルは次のようになります。gitignoreはopencv2.frameworkを無視していません

cd /path/to/my/repo 
git rm -r --cached 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 
+0

ダブルチェックをするだけで、変更を.gitignoreに追加してコミットしましたか? –

+0

[gitignoreを無視しないgitignoreの重複](https://stackoverflow.com/questions/23716553/gitignore-not-ignoring-file) – ha100

答えて

0

(私は##各種設定の下opencv2.framework書いた)Gitのステータス変更後の場合は、参照(そしてあなたはもうopencv2.framework/ファイルを見ない)、あなたの現在の状態をコミットしてください。

あなたはgit rm -r --cachedを実行する必要があります。

  • フォルダの親レポで(opencv2.framework/の親)を除去します。
    gitリポジトリからの削除を記録するために、追加してコミット(そして最終的にはプッシュ)します(ただし、--cachedオプションのおかげでディスクからは削除されません)。
  • がトラッキングされたファイルを削除するには、.gitignoreルールがにのみ適用されます。ファイルに適用されます。
+0

私はそのコマンドを入力し、「fatal:path spec 'opencv2.framework/'ファイルに一致しませんでした。' – jx8

+0

私はXcodeを使用しているので、一時的な回避策を見つけました:.gitignore(opencv2.framework)をコミットしている間、手動ですべてのopencv2ファイルのチェックを外して、しかし、gitの状態をチェックすると、opencv2ファイルはまだ新しいファイルとして表示されているので、gitが無視しているようには見えません。私は "git rm -r --cached opencv2.framework"を再度実行しようとしましたが、同じ致命的なメッセージが返されました。 – jx8

+0

@ jx8 Strange:あなたは右のfodler(opencv2.framework /の親)でgit rmをやりましたか? Gitリポジトリがそのフォルダを大文字で認識しているところで、低速/大文字の問題はありますか? – VonC

関連する問題