Skip to content

Instantly share code, notes, and snippets.

@creativecoder
Created August 8, 2013 02:54
Show Gist options
  • Save creativecoder/6181048 to your computer and use it in GitHub Desktop.
Save creativecoder/6181048 to your computer and use it in GitHub Desktop.
.gitignore all but the specified subdirectory
# Ignore all files except for a particular directory
*
# Don't ignore directories themselves, else we can't add anything to the repository
!*/
# Don't ignore any directory with the name "path"
!**/path/*
# or its subdirectories
!**/path/**/*
# And don't forget .gitignore itself
!.gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment