1

I have a master directory which contains 2 subdirectories:

  • 1 iOS project
  • 1 rails project

How can I ignore both these gitignores without having only one gitignore in the master directory as:

*.rbc
capybara-*.html
.rspec
/log
/tmp
/db/*.sqlite3
/db/*.sqlite3-journal
/public/system
/coverage/
/spec/tmp
**.orig
rerun.txt
pickle-email-*.html

## Environment normalisation:
/.bundle
/vendor/bundle

# these should all be checked in to normalise the environment:
# Gemfile.lock, .ruby-version, .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

# if using bower-rails ignore default bower_components path bower.json files
/vendor/assets/bower_components
*.bowerrc
bower.json

# Ignore pow environment settings
.powenv

# sublime text
*.sublime-*


# Xcode

.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode*
!default.mode*
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
*.xcworkspace
*.xcuserdata

#CocoaPods

Pods/
Podfile.lock

But it does not seem to well ignore my configuration, I want to avoid this:

# Xcode

mystore-ios/.DS_Store
mystore-ios/*/build/*
mystore-ios/*.pbxuser
mystore-ios/!default.pbxuser
mystore-ios/*.mode*
mystore-ios/!default.mode*
mystore-ios/*.perspectivev3
mystore-ios/!default.perspectivev3
mystore-ios/xcuserdata
mystore-ios/profile

How can I do?

james075
  • 1,280
  • 1
  • 12
  • 22

2 Answers2

1

.gitignore works in subdirectories so you can do:

master_directory/ios_project/.gitignore
master_directory/rails_project/.gitignore

These .gitignore files will override any .gitignore files from parent directories.

johnsorrentino
  • 2,731
  • 1
  • 16
  • 21
0

I have not tried this but .gitignore supports ** syntax as of version 1.8.2.1 to match and ignore through subdirectories. This answer in another question may be of use.

Community
  • 1
  • 1