简体   繁体   中英

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?

@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).

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

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM