Skip to content

Instantly share code, notes, and snippets.

@novrian
Forked from tijmenb/cakegittmpdirs
Last active December 14, 2015 03:49
Show Gist options
  • Save novrian/5024034 to your computer and use it in GitHub Desktop.
Save novrian/5024034 to your computer and use it in GitHub Desktop.
# Based on: http://stackoverflow.com/questions/2218075/using-git-with-your-cakephp-project
# Procedure:
# 1. Remove app/tmp/ from .gitignore
# 2. touch app/tmp/empty
# 3. git add app/tmp/empty
# 4. git commit
# 5. Add app/tmp/ to .gitignore
# Clean tmpfiles and delete .gitignore
rm .gitignore
rm -rf app/tmp
# Set up directories
mkdir -p app/tmp/cache/models
mkdir -p app/tmp/cache/persistent
mkdir -p app/tmp/cache/views
mkdir -p app/tmp/logs
mkdir -p app/tmp/sessions
mkdir -p app/tmp/tests
# Make the directories itself writeable
chmod -R 777 app/tmp
# Add empty files to the directories
touch app/tmp/cache/models/empty
touch app/tmp/cache/persistent/empty
touch app/tmp/cache/views/empty
touch app/tmp/logs/empty
touch app/tmp/sessions/empty
touch app/tmp/tests/empty
# Add all files to stage
git add app/tmp/*
# Commit the changes
git commit -m "Set up tmp dirs"
# Add app/tmp/* to gitignore
echo "app/tmp/*" && echo "!empty" > .gitignore
# done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment