Best way to use npm and git?

I’m quite new to both git and npm, but I understand the basics, at least I think I understand.
Anyway I will describe the way I’m thinking to work, but I think there are better ways to do.

  • I create the root folder with my node.js module.
  • I add the package.json file and configure the name and the version.
  • git init in this root folder.
  • Then git add . to add all the files to the source control.
  • Commit it. This would be my version 0.0.1. I don’t know how to set this in the git.
  • npm publish
  • And this is all for the first cycle.

Now for the next little change, not version:

  • git ssh doesn't work
  • App-Updater from git repo
  • Could not push--Failed to connect to github.com port 443: Connection refused
  • Automatically add remotes on git init
  • Git diff working incorrect - to many changes
  • Fork-specific git log
    • I change a file.
    • I change the version in package.json to 0.0.2.
    • I git commit.
    • done.
    • Same for other little changes, but don’t change the version.

    Now for the next version change:

    • I change the files
    • I change the version to the next.
    • I git commit.

    I would need some reference between the npm version and git version. How to do it?

  • Egit shows all files as changed
  • How do I add project-specific information to the Git commit comment?
  • How do you avoid that people forget to run 'git push'?
  • SVN checkout forbidden with all the tools
  • Create branch / pull request with only my commits
  • Trouble importing all perforce branches into git repo
  • One Solution collect form web for “Best way to use npm and git?”

    best practise is to add

    node_modules/*
    

    to .gitignore 🙂

    git is source control system and npm is package managment, ignore stuff like native packages that you use and thats all all the resto or “real” code has to go to module. Also if you have any config files like database.json put thme into ignore and put into repo sample like database.json.sample

    Thats it! :>

    You change npm package verison only when you have few comits and feature changes 🙂 so it is exclusive.

    Git Baby is a git and github fan, let's start git clone.