fix(core): update
This commit is contained in:
80
README.md
80
README.md
@@ -1,30 +1,28 @@
|
||||
# smartgit
|
||||
smart git wrapper for node.
|
||||
# @pushrocks/smartgit
|
||||
smart wrapper for nodegit
|
||||
|
||||
smartgit expects git to be installed on target machine.
|
||||
|
||||
## Availabililty
|
||||
[](https://www.npmjs.com/package/smartgit)
|
||||
[](https://gitlab.com/pushrocks/smartgit)
|
||||
[](https://github.com/pushrocks/smartgit)
|
||||
[](https://pushrocks.gitlab.io/smartgit/)
|
||||
## Availabililty and Links
|
||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartgit)
|
||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartgit)
|
||||
* [github.com (source mirror)](https://github.com/pushrocks/smartgit)
|
||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartgit/)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/pushrocks/smartgit/commits/master)
|
||||
[](https://gitlab.com/pushrocks/smartgit/commits/master)
|
||||
[](https://david-dm.org/pushrocks/smartgit)
|
||||
[](https://www.bithound.io/github/pushrocks/smartgit/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/smartgit)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
[](https://www.npmjs.com/package/@pushrocks/smartgit)
|
||||
[](https://snyk.io/test/npm/@pushrocks/smartgit)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
||||
## Usage
|
||||
|
||||
We recommend the use of TypeScript for best in class intellisense
|
||||
|
||||
```javascript
|
||||
// import smartgit:
|
||||
import { GitRepo } from 'smartgit'
|
||||
import { GitRepo } from 'smartgit';
|
||||
|
||||
// Initialize smartgit:
|
||||
// -- note: there are 3 ways to initialize smartgit
|
||||
@@ -33,36 +31,46 @@ import { GitRepo } from 'smartgit'
|
||||
// -- -- 3. with a new Git repo
|
||||
|
||||
// -- 1. existing Git Repo:
|
||||
let myExistingGitRepo = new GitRepo('/path/to/existing/git/repo/')
|
||||
let myExistingGitRepo = new GitRepo('/path/to/existing/git/repo/');
|
||||
|
||||
// -- 2. cloned Git Repo:
|
||||
let myClonedGitRepo: GitRepo
|
||||
smartgit.createRepoFromClone('git@github.com:username/reponame.git')
|
||||
.then(gitRepo => { // non blocking
|
||||
myClonedGitRepo = gitRepo
|
||||
})
|
||||
let myClonedGitRepo: GitRepo;
|
||||
smartgit.createRepoFromClone('git@github.com:username/reponame.git').then(gitRepo => {
|
||||
// non blocking
|
||||
myClonedGitRepo = gitRepo;
|
||||
});
|
||||
|
||||
// -- 3. new Git Repo
|
||||
let myNewGitRepo: GitRepo
|
||||
smartgit.createRepoFromInit('/path/to/new/folder') // smartgit will create any new folder, be careful
|
||||
.then(gitRepo => { // non blocking
|
||||
myNewGitRepo = gitRepo
|
||||
})
|
||||
let myNewGitRepo: GitRepo;
|
||||
smartgit
|
||||
.createRepoFromInit('/path/to/new/folder') // smartgit will create any new folder, be careful
|
||||
.then(gitRepo => {
|
||||
// non blocking
|
||||
myNewGitRepo = gitRepo;
|
||||
});
|
||||
|
||||
// Using smartgit instance
|
||||
// -- most used actions
|
||||
// -- all actions return promises, so make sure to use promise chaining for any dependent tasks
|
||||
myExistingGitRepo.addAll() // returns promise, stages all changed files
|
||||
myExistingGitRepo.add(['relative/path/to/file.txt','another/file2.txt']) // returns promise, stages specific files
|
||||
myExistingGitRepo.commit('my commit message') // returns promise, commits staged files
|
||||
myExistingGitRepo.status() // returns promise
|
||||
.then(status => { // Use TypeScript for status type information
|
||||
|
||||
})
|
||||
myExistingGitRepo.check() // returns promise, checks repo health
|
||||
myExistingGitRepo.remoteAdd('git@github.com:username/reponame.git')
|
||||
myExistingGitRepo.addAll(); // returns promise, stages all changed files
|
||||
myExistingGitRepo.add(['relative/path/to/file.txt', 'another/file2.txt']); // returns promise, stages specific files
|
||||
myExistingGitRepo.commit('my commit message'); // returns promise, commits staged files
|
||||
myExistingGitRepo
|
||||
.status() // returns promise
|
||||
.then(status => {
|
||||
// Use TypeScript for status type information
|
||||
});
|
||||
myExistingGitRepo.check(); // returns promise, checks repo health
|
||||
myExistingGitRepo.remoteAdd('git@github.com:username/reponame.git');
|
||||
```
|
||||
|
||||
Tip: use [smartssh](https://npmjs.com/smartssh) to setup your SSH environment
|
||||
|
||||
[](https://push.rocks)
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
|
Reference in New Issue
Block a user