Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Helper to manage SSH key for git

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
README.md

Git SSH Helper

Helper to manage SSH key for git

Installation

npm install git-ssh or npm install -g git-ssh

Methods

function create(email)     Use ssh-keygen tool to generate private/public key files for rsa format 
function import(path)      Import the private/public key files generated by user, then you use other commands
function where()           Display the location of private key file
function init()            Add the generated private key to the authentication agent, then you can use git to
                                connect to git repo by using ssh protocal
function quit()            Kill the ssh agent process

Example

var git_ssh = require('git-ssh');
git_ssh.create('username@sina.com');
git_ssh.import('C:\\dir\\id_rsa');
console.log('The location of ssh key file: ' + git_ssh.where());
git_ssh.init();
git_ssh.quit();
Something went wrong with that request. Please try again.