{"id":20551426,"url":"https://github.com/generate/generate-gitattributes","last_synced_at":"2025-04-14T11:20:58.990Z","repository":{"id":57246189,"uuid":"62935764","full_name":"generate/generate-gitattributes","owner":"generate","description":"Generate a .gitattributes file from the command line when Generate's CLI is installed globally, or use as a plugin or sub-generator in your own generator.","archived":false,"fork":false,"pushed_at":"2016-08-17T15:22:27.000Z","size":382,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T02:03:07.535Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/generate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-09T06:22:15.000Z","updated_at":"2024-05-13T01:15:33.000Z","dependencies_parsed_at":"2022-08-24T16:31:41.234Z","dependency_job_id":null,"html_url":"https://github.com/generate/generate-gitattributes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-gitattributes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-gitattributes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-gitattributes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-gitattributes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generate","download_url":"https://codeload.github.com/generate/generate-gitattributes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248758422,"owners_count":21156958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T02:30:51.297Z","updated_at":"2025-04-14T11:20:58.967Z","avatar_url":"https://github.com/generate.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\n\u003ca href=\"https://github.com/generate/generate\"\u003e\n\u003cimg height=\"150\" width=\"150\" src=\"https://raw.githubusercontent.com/generate/generate/master/docs/logo.png\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\nGenerate a .gitattributes file from the command line when Generate's CLI is installed globally, or use as a plugin or sub-generator in your own generator to make it a continuous part of the build workflow when scaffolding out a new project.\n\n# generate-gitattributes\n\n[![NPM version](https://img.shields.io/npm/v/generate-gitattributes.svg?style=flat)](https://www.npmjs.com/package/generate-gitattributes) [![NPM downloads](https://img.shields.io/npm/dm/generate-gitattributes.svg?style=flat)](https://npmjs.org/package/generate-gitattributes) [![Build Status](https://img.shields.io/travis/generate/generate-gitattributes.svg?style=flat)](https://travis-ci.org/generate/generate-gitattributes)\n\n![generate-gitattributes demo](https://raw.githubusercontent.com/generate/generate-gitattributes/master/docs/demo.gif)\n\n**Example**\n\nTemplates are [customizable](#customization) and can be overridden.\n\n![generate-gitattributes demo](https://raw.githubusercontent.com/generate/generate-gitattributes/master/docs/demo.gif)\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## What is \"Generate\"?\n\nGenerate is a command line tool and developer framework for scaffolding out new GitHub projects using [generators](https://github.com/generate/generate/blob/master/docs/generators.md) and [tasks](https://github.com/generate/generate/blob/master/docs/tasks.md).\n\nAnswers to prompts and the user's environment can be used to determine the templates, directories, files and contents to build. Support for [gulp](http://gulpjs.com), [base](https://github.com/node-base/base) and [assemble](https://github.com/assemble/assemble) plugins, and much more.\n\n**For more information**:\n\n* Visit the [generate project](https://github.com/generate/generate/)\n* Visit the [generate documentation](https://github.com/generate/generate/blob/master/docs/)\n* Find [generators on npm](https://www.npmjs.com/browse/keyword/generate-generator) (help us [author generators](https://github.com/generate/generate/blob/master/docs/micro-generators.md))\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Command line usage\n\n### Install globally\n\n**Installing the CLI**\n\nTo run the `gitattributes` generator from the command line, you'll need to install [Generate](https://github.com/generate/generate) globally first. You can do that now with the following command:\n\n```sh\n$ npm install --global generate\n```\n\nThis adds the `gen` command to your system path, allowing it to be run from any directory.\n\n**Install generate-gitattributes**\n\nInstall this module with the following command:\n\n```sh\n$ npm install --global generate-gitattributes\n```\n\n### Running generate-gitattributes\n\nYou should now be able to run `generate-gitattributes` with the following command:\n\n```sh\n$ gen gitattributes\n```\n\n**What will happen?**\n\nRunning `$ gen gitattributes` will run the generator's [default task](#default), which writes a `.gitattributes` file to the current working directory, or the [specified directory](#customization).\n\n**What you should see in the terminal**\n\nIf completed successfully, you should see both `starting` and `finished` events in the terminal, like the following:\n\n```sh\n[00:44:21] starting ...\n...\n[00:44:22] finished ✔\n```\n\nIf you do not see one or both of those events, please [let us know about it](../../issues).\n\n### Help\n\nTo see a general help menu and available commands for Generate's CLI, run:\n\n```sh\n$ gen help\n```\n\n## Running multiple generators\n\n[generate](https://github.com/generate/generate) supports running multiple generators at once. Here is an example of a generator that works well with `generate-gitattributes`.\n\n### generate-dest\n\nRun [generate-dest](https://github.com/generate/generate-dest) **before** this generator to prompt for the destination directory to use for generated files.\n\n**Example**\n\n![generate-gitattributes generate-dest example](https://raw.githubusercontent.com/generate/generate-gitattributes/master/docs/demo-dest.gif)\n\n## API usage\n\nUse `generate-gitattributes` as a [plugin](https://github.com/generate/generate/blob/master/docs/plugins.md) in your own [generator](https://github.com/generate/generate/blob/master/docs/generators.md).\n\n### Install locally\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save generate-gitattributes\n```\n\n### Register as a plugin\n\nInside your own [generator](https://github.com/generate/generate/blob/master/docs/generators.md):\n\n```js\nmodule.exports = function(app) {\n  // register generate-gitattributes as a plugin to add the gitattributes\n  // task to your own generator\n  app.use(require('generate-gitattributes'));\n};\n```\n\n### Run tasks\n\nProgrammatically run tasks from `generate-gitattributes`.\n\n```js\nmodule.exports = function(app) {\n  // adds the `gitattributes` task to your generator\n  app.use(require('generate-gitattributes'));\n\n  // run the `gitattributes` task\n  app.task('default', 'gitattributes');\n};\n```\n\nVisit the [generator docs](https://github.com/generate/generate/blob/master/docs/generators.md) to learn more about creating, installing, using and publishing generators.\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Customization\n\nThe following instructions can be used to override settings in `generate-gitattributes`. Visit the [Generate documentation](https://github.com/generate/generate/blob/master/docs/overriding-defaults.md) to learn about other ways to override defaults.\n\n### Destination directory\n\nTo customize the destination directory, install [generate-dest](https://github.com/generate/generate-dest) globally, then in the command line prefix `dest` before any other generator names.\n\nFor example, the following will prompt you for the destination path to use, then pass the result to `generate-gitattributes`:\n\n```sh\n$ gen dest gitattributes\n```\n\n### Overriding templates\n\nYou can override a template by adding a template of the same name to the `templates` directory in user home. For example, to override the `.gitattributes` template, add a template at the following path `~/generate/generate-gitattributes/templates/.gitattributes`, where `~/` is the user-home directory that `os.homedir()` resolves to on your system.\n\n## What is \"Generate\"?\n\nGenerate is a command line tool and developer framework for scaffolding out new GitHub projects using [generators](https://github.com/generate/generate/blob/master/docs/generators.md) and [tasks](https://github.com/generate/generate/blob/master/docs/tasks.md).\n\nAnswers to prompts and the user's environment can be used to determine the templates, directories, files and contents to build. Support for [gulp](http://gulpjs.com), [base](https://github.com/node-base/base) and [assemble](https://github.com/assemble/assemble) plugins, and much more.\n\n**For more information**:\n\n* Visit the [generate project](https://github.com/generate/generate/)\n* Visit the [generate documentation](https://github.com/generate/generate/blob/master/docs/)\n* Find [generators on npm](https://www.npmjs.com/browse/keyword/generate-generator) (help us [author generators](https://github.com/generate/generate/blob/master/docs/micro-generators.md))\n\n## Getting started\n\n### Install\n\n**Installing the CLI**\n\nTo run the `gitattributes` generator from the command line, you'll need to install [Generate](https://github.com/generate/generate) globally first. You can do that now with the following command:\n\n```sh\n$ npm install --global generate\n```\n\nThis adds the `gen` command to your system path, allowing it to be run from any directory.\n\n**Install generate-gitattributes**\n\nInstall this module with the following command:\n\n```sh\n$ npm install --global generate-gitattributes\n```\n\n### Usage\n\nRun this generator's `default` [task](https://github.com/generate/generate/blob/master/docs/tasks.md#default) with the following command:\n\n```sh\n$ gen gitattributes\n```\n\n**What you should see in the terminal**\n\nIf completed successfully, you should see both `starting` and `finished` events in the terminal, like the following:\n\n```sh\n[00:44:21] starting ...\n...\n[00:44:22] finished ✔\n```\n\nIf you do not see one or both of those events, please [let us know about it](../../issues).\n\n### Help\n\nTo see a general help menu and available commands for Generate's CLI, run:\n\n```sh\n$ gen help\n```\n\n## Tasks\n\nAll available tasks.\n\n### [gitattributes](generator.js#L20)\n\nGenerates a `.gitattributes` file to the current working directory. The built-in template can be [overridden](#customization).\n\n**Example**\n\n```sh\n$ gen gitattributes\n```\n\nVisit Generate's [documentation for tasks](https://github.com/generate/generate/blob/master/docs/tasks.md).\n\n## About\n\n### Community\n\nAre you using [Generate](https://github.com/generate/generate) in your project? Have you published a [generator](https://github.com/generate/generate/blob/master/docs/generators.md) and want to share your project with the world?\n\nHere are some suggestions!\n\n* If you get like Generate and want to tweet about it, please feel free to mention `@generatejs` or use the `#generatejs` hashtag\n* Show your love by starring [Generate](https://github.com/generate/generate) and `generate-gitattributes`\n* Get implementation help on [StackOverflow](http://stackoverflow.com/questions/tagged/generate) (please use the `generatejs` tag in questions)\n* **Gitter** Discuss Generate with us on [Gitter](https://gitter.im/generate/generate)\n* If you publish an generator, thank you! To make your project as discoverable as possible, please add the keyword `generategenerator` to package.json.\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT license](https://github.com/generate/generate-gitattributes/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on August 17, 2016._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerate%2Fgenerate-gitattributes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenerate%2Fgenerate-gitattributes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerate%2Fgenerate-gitattributes/lists"}