Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Git
Git

33.7K
27K
+ 1
6.6K
npm
npm

19.4K
14.8K
+ 1
1.6K
Add tool

Git vs npm: What are the differences?

Developers describe Git as "Fast, scalable, distributed revision control system". Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. On the other hand, npm is detailed as "The package manager for JavaScript". npm is the command-line interface to the npm ecosystem. It is battle-tested, surprisingly flexible, and used by hundreds of thousands of JavaScript developers every day.

Git can be classified as a tool in the "Version Control System" category, while npm is grouped under "Front End Package Manager".

"Distributed version control system", "Efficient branching and merging" and "Fast" are the key factors why developers consider Git; whereas "Best package management system for javascript", "Open-source" and "Great community" are the primary reasons why npm is favored.

Git and npm are both open source tools. Git with 28.2K GitHub stars and 16.3K forks on GitHub appears to be more popular than npm with 17.2K GitHub stars and 3.17K GitHub forks.

Netflix, reddit, and Lyft are some of the popular companies that use Git, whereas npm is used by reddit, Instacart, and Coursera. Git has a broader approval, being mentioned in 3932 company stacks & 4778 developers stacks; compared to npm, which is listed in 2642 company stacks and 2666 developer stacks.

What is Git?

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

What is npm?

npm is the command-line interface to the npm ecosystem. It is battle-tested, surprisingly flexible, and used by hundreds of thousands of JavaScript developers every day.
Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Why do developers choose Git?
Why do developers choose npm?

Sign up to add, upvote and see more prosMake informed product decisions

Sign up to add, upvote and see more consMake informed product decisions

Jobs that mention Git and npm as a desired skillset
What companies use Git?
What companies use npm?

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Git?
What tools integrate with npm?

Sign up to get full access to all the tool integrationsMake informed product decisions

What are some alternatives to Git and npm?
GitHub
GitHub is the best place to share code with friends, co-workers, classmates, and complete strangers. Over three million people use GitHub to build amazing things together.
SVN (Subversion)
Subversion exists to be universally recognized and adopted as an open-source, centralized version control system characterized by its reliability as a safe haven for valuable data; the simplicity of its model and usage; and its ability to support the needs of a wide variety of users and projects, from individuals to large-scale enterprise operations.
Bitbucket
Bitbucket gives teams one place to plan projects, collaborate on code, test and deploy, all with free private Git repositories. Teams choose Bitbucket because it has a superior Jira integration, built-in CI/CD, & is free for up to 5 users.
Perforce
Visibility, access control, workflow and code management for Git environments. Flexibility of collaborating on the same codebase and code reviews using any combination of Perforce and Git workflows and tools without compromise.
Mercurial
Mercurial is dedicated to speed and efficiency with a sane user interface. It is written in Python. Mercurial's implementation and data structures are designed to be fast. You can generate diffs between revisions, or jump back in time within seconds.
See all alternatives
Decisions about Git and npm
rishig
rishig
Head of Product at Zulip · | 4 upvotes · 23.1K views
atZulipZulip
Git
Git
SVN (Subversion)
SVN (Subversion)

I use Git instead of SVN (Subversion) because it allows us to scale our development team. At any given time, the Zulip open source project has hundreds of open pull requests from tens of contributors, each in various stages of the pipeline. Git's workflow makes it very easy to context switch between different feature branches.

See more
Tim Abbott
Tim Abbott
Founder at Zulip · | 7 upvotes · 22K views
atZulipZulip
Git
Git
Mercurial
Mercurial

I've been excited about Git ever since it got a built-in UI. It's the perfect combination of a really solid, simple data model, which allows an experienced user to predict precisely what a Git subcommand will do, often without needing to read the documentation (see the slides linked from the attached article for details). Most important to me as the lead developer of a large open source project (Zulip) is that it makes it possible to build a really clean, clear development history that I regularly use to understand details of our code history that are critical to making correct changes.

And it performs really, really well. In 2014, I managed Dropbox's migration from Mercurial to Git. And just switching tools made just about every common operation (git status, git log, git commit etc.) 2-10x faster than with Mercurial. It makes sense if you think about it, since Git was designed to perform well with Linux, one of the largest open source projects out there, but it was still a huge productivity increase that we got basically for free.

If you're learning Git, I highly recommend reading the other sections of Zulip's Git Guide; we get a lot of positive feedback from developers on it being a useful resource even for their projects unrelated to Zulip.

See more
Tim Abbott
Tim Abbott
Founder at Zulip · | 3 upvotes · 10.3K views
atZulipZulip
Yarn
Yarn
npm
npm
Node.js
Node.js

I have mixed feelings on the Yarn/npm/Node.js ecosystem. We use it for Zulip, because you basically have to in order to have a modern JavaScript toolchain. And I like that Yarn lets us pin dependency versions out of the box for predictability in our production releases; we have to do significant work for the Python version of this feature.

But one also deals with broken third-party dependencies uploaded to npm way too often (even ignoring the malicious packages issues that have gotten a lot of press of late). And one mostly has to use nvm in order to pin a specific version of node itself in a maintainable way, and nvm is a mess.

See more
Russel Werner
Russel Werner
Lead Engineer at StackShare · | 5 upvotes · 7.5K views