对于:
想要忽略项目根目录下面的
Carthage文件夹及其下所有的子文件夹和文件
gitignore 文件夹
github/gitignore: A collection of useful .gitignore templates
gitignore/Xcode.gitignore at master · github/gitignore
#Mac specific *.DS_Store ## Build generated build/ DerivedData/ ## Various settings *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata/ WorkspaceSettings.xcsettings #debug related xcdebugger *.xcbkptlist ## Other *.moved-aside *.xcuserstate UserInterfaceState.xcuserstate ## 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/ .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/ # 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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output |
[总结]
git中的.gitignore文件中,忽略整个文件夹的写法是:
yourFolderName/
比如:
上述想要忽略Carthage文件夹,则写成:
Carthage/
对应的,忽略单个文件的写法:
yourSingleFilename
转载请注明:在路上 » [已解决]git中忽略整个文件夹