eat-sleep-code
eat-sleep-code

Reputation: 4855

Node.js - How to sync files to/from GitHub

I am just beginning to work with Node.js.

I have run npm init.

One of the items it prompts me for is a Git repository. I provided the address to a new (only containing the README.md) public GitHub repository.

If I create a new file from my desktop and check it in to the repository -- how does that file get synced to my server running Node.js.

Is there an npm command to do so or is it handled automatically?

Upvotes: 1

Views: 1105

Answers (2)

Lafras Henning
Lafras Henning

Reputation: 133

Workflow as follows:

Create Git (on git hub),

clone to local,

npm init ( the git repo prompt is just for reference (AFAIK), it uses it on npm website)

while(1){

    add some code,

    increment package version

    commit,

    git push,

    npm publish,

    optional un-publish old UNUSED versions

}

Upvotes: 0

eat-sleep-code
eat-sleep-code

Reputation: 4855

@Brad's answer above was helpful.

I discovered Notepad++ has built in support for writing directly to an SSH/SFTP location, which allows me to write code from the convenience of my desktop (instead of nano or vi on the server).

Upvotes: 1

Related Questions