Skip to content

Instantly share code, notes, and snippets.

@adamwiggall
Last active December 20, 2015 18:38
Show Gist options
  • Save adamwiggall/6176874 to your computer and use it in GitHub Desktop.
Save adamwiggall/6176874 to your computer and use it in GitHub Desktop.
Often you have a directory in a git repo that you want to share amongst developers, but you don't want the contents tracked. As git ignores empty directories, if you just .gitignore the directory completely it will never get added to the repo and shared. The example shows how to use this technique for the cache folder in an expressionengine inst…
From the command line
$ touch your/path/to/expressionengine/cache/.gitkeep
In your .gitignore file
your/path/to/expressionengine/cache/*
!your/path/to/expressionengine/cache/.gitkeep
@dennisfrank
Copy link

Nice. I think with !.gitkeep you don’t have to add .gitkeep for every ignored directory.

@ajp
Copy link

ajp commented Aug 7, 2013

I usually drop a .gitignore into that specific folder. I'll have to give this a try.

@aaronwaldon
Copy link

Excellent simple solution!

@kmgdevelopment
Copy link

This is great, thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment