You can also put something like this in .gitignore:

```.gitignore
node_modules
!node_modules/foo
```

and it'll ignore everything in node_modules *except* node_modules/foo.


On Fri, Oct 12, 2012 at 9:27 AM, Aseem Kishore <[email protected]> wrote:
> Surprised no one has mentioned this yet:
>
> You can .gitignore node_modules but still manually check in files under
> node_modules. Git will just ask you to add a -f flag if you really mean to
> check those in.
>
> We do this for our own private modules. (Actually, what we check into
> node_modules are just symlinks. Our modules live in their own directories
> alongside the requiring module.)
>
> Aseem
>
> On Thu, Oct 11, 2012 at 4:37 AM, Mariusz Nowak <[email protected]> wrote:
>>
>> Tom:
>>
>> Have you tried following in .gitignore:
>>
>> node_modules/*
>> !node_modules/my-private-package1
>> !node_modules/my-private-package2
>>
>>
>> On Wednesday, October 10, 2012 5:09:27 PM UTC+2, Tom wrote:
>>>
>>> I've added the node_modules folder to my .gitignore file, which works
>>> fine thanks to NPM Shrinkwrap (after deploying I need to run npm install
>>> using the shrinkwrap.json file).
>>>
>>> However, I've got some private modules now that I won't publish to NPM. I
>>> would like to require these modules like the other modules in node_modules.
>>>
>>> Unfortunately I cannot put these modules in node_modules, because they'd
>>> be ignored by git, messing with my future deployment.
>>>
>>> Where should I place these modules instead? I've been told that editing
>>> the paths variable for node's module lookup is highly unrecommended.
>>>
>>> Note that these are small undocumented nonpublic modules, which is why I
>>> don't want to publish them to NPM.
>>>
>>> Tom
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to