{"id":20947730,"url":"https://github.com/alphahydrae/gitenv","last_synced_at":"2025-05-14T02:30:28.121Z","repository":{"id":4753667,"uuid":"5903618","full_name":"AlphaHydrae/gitenv","owner":"AlphaHydrae","description":"Symlink manager for git repositories with configuration files.","archived":false,"fork":false,"pushed_at":"2024-10-28T18:59:34.000Z","size":161,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-31T13:29:17.534Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/AlphaHydrae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-09-21T15:48:00.000Z","updated_at":"2024-09-19T20:53:52.000Z","dependencies_parsed_at":"2023-07-12T13:16:40.163Z","dependency_job_id":null,"html_url":"https://github.com/AlphaHydrae/gitenv","commit_stats":{"total_commits":78,"total_committers":2,"mean_commits":39.0,"dds":"0.28205128205128205","last_synced_commit":"ab69b762e91f50af56020877c3470e350ed388cd"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fgitenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fgitenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fgitenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fgitenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlphaHydrae","download_url":"https://codeload.github.com/AlphaHydrae/gitenv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225270612,"owners_count":17447635,"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-19T00:12:49.230Z","updated_at":"2024-11-19T00:12:49.706Z","avatar_url":"https://github.com/AlphaHydrae.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitenv\n\nCreates symlinks to your configuration files in a git repository (\u003ca href=\"https://github.com/AlphaHydrae/env\"\u003elike mine\u003c/a\u003e).\n\n[![Gem Version](https://badge.fury.io/rb/gitenv.svg)](http://badge.fury.io/rb/gitenv)\n[![Build](https://github.com/AlphaHydrae/gitenv/actions/workflows/build.yml/badge.svg)](https://github.com/AlphaHydrae/gitenv/actions/workflows/build.yml)\n[![Code Coverage](https://codecov.io/gh/AlphaHydrae/gitenv/branch/main/graph/badge.svg?token=PHYTXEW2MG)](https://codecov.io/gh/AlphaHydrae/gitenv)\n\nRun gitenv without arguments to check the symlink configuration. First-time users will be prompted to enter the path to their environment repository so gitenv can set up its own config file.\n\n    #=\u003e gitenv\n\n     ~/.gemrc -\u003e ~/projects/env/.gemrc           ok\n     ~/.gitconfig -\u003e ~/projects/env/.gitconfig   not yet set up\n     ~/.zshrc -\u003e ~/projects/env/.zshrc           not yet set up\n\nThen run it with **apply** to set up the missing symlinks.\n\n    #=\u003e gitenv apply\n\n     ~/.gemrc -\u003e ~/projects/env/.gemrc           ok\n     ~/.gitconfig -\u003e ~/projects/env/.gitconfig   ok\n     ~/.zshrc -\u003e ~/projects/env/.zshrc           ok\n\nRead on for \u003ca href=\"#configuration\"\u003emore advanced options\u003c/a\u003e.\n\n## Installation\n\n    gem install gitenv\n\n\u003ca name=\"configuration\"\u003e\u003c/a\u003e\n## Configuration\n\nIf your repository is more complex than a bunch of dot files or you want to put the links somewhere other than in your home folder, you will have to customize your configuration file. Gitenv prompts you to create one the first time you run it. It looks for `~/.gitenv.rb` by default. You can override this with the `-c, --config` option or by setting the `GITENV_CONFIG` environment variable.\n\nThe following sections demonstrate the various options you can customize in the configuration file.\n\n### Repository\n\n```ruby\n# Path to your environment repository.\nrepo '~/projects/env'\n\n# Note that you can also set the GITENV_REPO environment variable.\n```\n\n### Symlinks\n\n```ruby\n# This will create symlinks in your home folder to all dot files (e.g. .vimrc, .gitconfig) in the repository.\nsymlink dot_files\n\n# This creates symlinks for all files, not just dot files.\nsymlink all_files\n\n# You can also create symlinks one at a time.\nsymlink '.zshrc'\nsymlink 'my_config_file'\n\n# If you want the name of link to be different than that of the file, use the :as option.\nsymlink 'zshconfig', :as =\u003e '.zshconfig'\n```\n\n### Sub-folders in the repository\n\n```ruby\n# If your configuration file or files are in a sub-folder, use #from to tell gitenv where to find them.\nfrom 'subfolder' do\n  symlink dot_files\nend\n\n# The following syntax is also available.\nsymlink('.zshrc').from('zsh')\nsymlink(all_files).from('a/b/c')\n\n# You can chain several #from calls to traverse hierarchies.\nfrom 'a' do\n  from 'b' do\n    from 'c' do\n      # Symlink all dot files in a/b/c in your repository.\n      symlink dot_files\n    end\n  end\nend\n```\n\n### Change the destination\n\n```ruby\n# If you want to put the symlinks somewhere other than in your home folder, use #to.\nto 'links' do\n  symlink dot_files\nend\n\n# The following syntax is also available.\nsymlink('.zshrc').to('links')\nsymlink(all_files).to('a/b/c')\n\n# Paths are relative to your home folder. If you need an absolute path, use #to_abs.\nsymlink('my_config_file').to_abs('/opt/config')\n```\n\n### Copy files\n\n```ruby\n# Gitenv can also copy files instead of creating symlinks.\ncopy dot_files\n\n# Path modifiers work the same as for symlinks.\ncopy(dot_files).from('zsh')\ncopy('my_config_file').to('configs')\n```\n\n### Symlinks or copies in system directories\n\nJust use `sudo`. Gitenv will happily set up your symlinks. You might have to add the `-E` switch to keep gitenv in the PATH.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphahydrae%2Fgitenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphahydrae%2Fgitenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphahydrae%2Fgitenv/lists"}