简体   繁体   中英

How to clone private git repository in node.js

The idea is the following:

node.js in the application should be able to clone private github repositories using ssh. After User send his/her ssh key, the application could be able to clone his repository.

I think about using GIT_SSH variable to use multiple ssh keys. Can any one tell me how this could be implemented?

You may want to reconsider the idea of users sending you their private SSH keys. I would be very surprised if anyone would do that.

What you can do instead is to use the GitHub API and deploy keys , that can be made read only. See:

For a good introduction on how you can access Git repos fron Node, see:

Examples in that article use NodeGit . It has excellent documentation on:

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