title: Xcode 12 Source control -> .gitignore file
body: <p>I'm trying to ignore all images from my project.</p>
  <p>I have a .gitignore file in the root directory where the project file is located. I created this file with &quot;touch .gitignore&quot; then I applied a generated input from <a href="https://www.gitignore.io" rel="nofollow noreferrer">https://www.gitignore.io</a> with the keywords swift and xcode. After that I applied below the &quot;Others&quot; comment following pattern</p>
  <p>*.png
  *.imageasset</p>
  <p>to ignore all images.</p>
  <p>For specific folders and files it works, the source control in xcode doesnt show me this files anymore for a commit, but the images will always shown. I also tried to block a image through the Preferences -&gt; Source Control -&gt; Git -&gt; Ignore files, but it didnt worked.</p>
  <p><strong>By the way</strong>
  The image files are not in my repository, I have never committed them.</p>
  <p>The .gitignore file:</p>
  <pre><code># Created by https://www.gitignore.io/api/swift,xcode
  
  ### Swift ###
  # Xcode
  #
  # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore &amp; Swift.gitignore
  
  ## Build generated
  build/
  DerivedData/
  
  ## Various settings
  *.pbxuser
  !default.pbxuser
  *.mode1v3
  !default.mode1v3
  *.mode2v3
  !default.mode2v3
  *.perspectivev3
  !default.perspectivev3
  xcuserdata/
  
  ## Other
  *.moved-aside
  *.xccheckout
  *.xcscmblueprint
  *.png
  *.imageasset
  
  ## 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 - Refactored to standalone file
  
  # Carthage - Refactored to standalone file
  
  # 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
  
  ### Xcode ###
  # Xcode
  #
  # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore &amp; Swift.gitignore
  
  ## Build generated
  
  ## Various settings
  
  ## Other
  
  ### Xcode Patch ###
  *.xcodeproj/*
  !*.xcodeproj/project.pbxproj
  !*.xcodeproj/xcshareddata/
  !*.xcworkspace/contents.xcworkspacedata
  /*.gcno
  
  # End of https://www.gitignore.io/api/swift,xcode
  </code></pre>