I also wanted to blog in order to write this down in case I needed to do it again:
I put all my Learn C the Hard Way exercises into a git repository so that I would have access to their revision history, but I forgot about all the compiled files and ended up with this as the repo folder. I don't have make set up to use the .out suffix, so I couldn't just add the compiled files to the gitignore. Instead I found this guide online and set up my .gitignore following it:
File: .gitignore # ignore everything * # Don't ignore directories, so we can recurse into them !*/ # Don't ignore other important files !.gitignore !*.c !*.java !*.py !*.rbThen, to remove all the files I didn't want that had already been committed, I did
git rm -rf . --cached
, which removed all the files from my git path, while keeping them on the local machine. Then I did git add .
to add all the files allowed by the gitignore back into the path.This isn't the perfect solution, because every time I add a new file type I'll have to add it manually, but it works for now. I ended up with a much cleaner directory.
Also I found a javascript web mocking library called Nock, so hopefully that will allow us to test the HttpRequestHandler object easily.
This is cool! Thanks. I'll remember this post and make use of it.
ReplyDelete