aburd / price_remover

A node.js app that takes out all this pesky html out of old documents.
0 stars 0 forks source link

Remove Node modules directory. #1

Closed josephdburdick closed 8 years ago

josephdburdick commented 8 years ago

Hey, you really want to remove the Node modules from being versioned in Git. They make your repo large and you should leverage npm to handle dependencies.

  1. Add "node_modules" to a file in the root of the directory named .gitignore. You may need to look into rewriting Git history so they are never included.
  2. Remove the node_modules directory from the git repo history http://stackoverflow.com/questions/5563564/completely-remove-files-from-git-repo-and-remote-on-github
  3. That's it!

This is good practice, I know it may seem unnecessary now but later on down the road, if you want to use this price remover as a module to something else, it'll be easier to plug and play and also make it easier for people to collaborate.

aburd commented 8 years ago

Hey big bro!

As always thank you for the advice! I will implement it when I get home tonight. Learnin' a ton, trust me.

Good to know that's what gitignore is for. I feel noob all day everydayyyyy.

Yeah, it's always something I saw the necessity for every since I started, but didn't know how to do it. Looking at one folder when you download a module is baffling.

josephdburdick commented 8 years ago

Yeah, I understand. You won't have to worry too much about the contents of the node_modules directory because each module likely has it's OWN node_modules dir with their own dependencies. It can easily get pretty dense.

Another reason to use .gitignore right off the bat is to keep sensitive data out of the Github repo. If you're working on a large project and any sensitive data gets pushed to the online repository, you should consider that information potentially compromised and take necessary precautions.

The following command will retroactively remove a Git cached file or directory:

git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch DIR_PATH_HERE/*'

Don't fret, I never memorize that command. I'm just aware of it and keep my Google Fu sharp.

aburd commented 8 years ago

Yo Josephus,

I just wanted to say thanks for the tip. Actually took care of this a while ago, but forgot to close this thread. As always, thanks for the help bro.

josephdburdick commented 8 years ago

:+1: no prob mang