I've got a project that I'm deploying to heroku. The source code tree includes a bunch of mp3 files (the website will be for a recording project I was heavily involved with).
I'd like to put the source code for it up on github, but github has a 300 MB limit on their free accounts. I don't want to use 50 MB of my limit on a bunch of mp3 files. Obviously, I could add them to the
git push heroku
$ git init git-ignore-test
$ cd git-ignore-test
$ echo "*.ignored" >> .gitignore
$ git add .gitignore && git commit -m "Ignore .ignored files"
$ touch Foo.ignored
$ git checkout -b unignored
$ cat /dev/null > .gitignore
$ git add Foo.ignored .gitignore && git commit -m "Unignore .ignored files"
IMPORTANT: This solution is reported to be not working (anymore?). See comments.
I wrote a blog post on how to effectively use the
excludesfile for different branches, like one for public github and one for heroku deployment.
Here's the quick and dirty:
$ git branch public_viewing $ cd .git/ $ touch info/exclude_from_public_viewing $ echo "path/to/secret/file" > info/exclude_from_public_viewing
then in the .git/config file add these lines:
[core] excludesfile = +info/exclude [branch "public_viewing"] excludesfile = +info/exclude_from_public_viewing
Now all the global ignore stuff is in the
info/exclude file and the branch specific is in the
Hope that helps!