Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joseluisq/gitd
Use Git to fetch all source files from any repository. :octocat:
https://github.com/joseluisq/gitd
branch clone directories download files git tag
Last synced: 16 days ago
JSON representation
Use Git to fetch all source files from any repository. :octocat:
- Host: GitHub
- URL: https://github.com/joseluisq/gitd
- Owner: joseluisq
- License: mit
- Created: 2017-02-04T13:11:24.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-03-15T21:32:23.000Z (over 4 years ago)
- Last Synced: 2024-05-28T11:54:29.838Z (6 months ago)
- Topics: branch, clone, directories, download, files, git, tag
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Gitd [![Build Status](https://travis-ci.org/joseluisq/gitd.svg?branch=master)](https://travis-ci.org/joseluisq/gitd) [![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) [![Greenkeeper badge](https://badges.greenkeeper.io/joseluisq/gitd.svg)](https://greenkeeper.io/)
> Use [Git](https://git-scm.com/) to fetch all source files from any repository. :octocat:
## Prerequisites
- [NodeJS](https://nodejs.org) v4.0 or greater.
- [Git](https://git-scm.com/).
- Unix-like operating systems only (this package uses a shell script). :penguin:## Install
[Yarn](https://github.com/yarnpkg/)
```sh
yarn add gitd --dev
```[NPM](https://www.npmjs.com/)
```sh
npm install gitd --save-dev
```## Usage
`gitd` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) object. When promise is fulfilled the `directory` value is passed else when it is `rejected` an `Error` object is passed.
```js
const gitd = require('gitd')gitd({
repository: 'https://github.com/joseluisq/gitd.git',
directory: '.tmp',
branch: 'master',
})
.then(dir => console.log(`Files downloaded at "${dir}"`))
.catch(err => console.error(err.message))
```## Options
| Name | Required | Description
| ------------- | ------------- | ------------- |
| __repository__ | Required | Git repository URL. |
| __directory__ | Required | Empty directory path. (Git could create the directory if not exists) |
| __branch__ | Optional | `master` by default. You can also provide a `tag` name. |## License
MIT license© 2017 [José Luis Quintana](http://quintana.io)