Skip to content

Instantly share code, notes, and snippets.

@jk
Created February 12, 2015 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jk/197bc12063c69ab93468 to your computer and use it in GitHub Desktop.
Save jk/197bc12063c69ab93468 to your computer and use it in GitHub Desktop.
Within composer's vendor directory MUST NOT contain any modification. This script cleans it up for git repos.
#!/bin/sh
GIT=`which git`
GIT_DIRS=`find vendor -name .git -type d`
for GIT_DIR in $GIT_DIRS; do
if [ -d "${GIT_DIR}" ]; then
WORK_TREE=`dirname ${GIT_DIR}`
${GIT} --git-dir=${GIT_DIR} --work-tree=${WORK_TREE} clean -f
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment