Skip to content

Instantly share code, notes, and snippets.

@matthewmccullough
Created January 24, 2011 16:06
Show Gist options
  • Select an option

  • Save matthewmccullough/793430 to your computer and use it in GitHub Desktop.

Select an option

Save matthewmccullough/793430 to your computer and use it in GitHub Desktop.
Recursively ignore a target directory in Git
git init testrecursiveignore
cd testrecursiveignore
mkdir target
echo buildjunk > target/build1.log
mkdir -p subproject/target
echo buildjunk > subproject/target/build2.log
echo //HelloWorld >> code/mycode.java
git add code/mycode.java
git commit -m'Adding code'
echo target >> .gitignore
git add .gitignore
git commit -m'Ignoring all target folders recursively'
## All target files or folders are recursively ignored
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment