{"id":28389764,"url":"https://github.com/0ghny/gitconfig","last_synced_at":"2025-06-27T21:32:32.939Z","repository":{"id":54844235,"uuid":"522716160","full_name":"0ghny/gitconfig","owner":"0ghny","description":"Cli to manage multiple gitconfigs with ease","archived":false,"fork":false,"pushed_at":"2022-09-01T09:25:07.000Z","size":37,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-31T11:36:11.944Z","etag":null,"topics":["cli","git","golang"],"latest_commit_sha":null,"homepage":"https://0ghny.github.io/gitconfig","language":"Go","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/0ghny.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":"2022-08-08T21:44:57.000Z","updated_at":"2025-03-26T14:13:50.000Z","dependencies_parsed_at":"2022-08-14T04:31:17.650Z","dependency_job_id":null,"html_url":"https://github.com/0ghny/gitconfig","commit_stats":null,"previous_names":["0ghny/gitconfigs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/0ghny/gitconfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0ghny%2Fgitconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0ghny%2Fgitconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0ghny%2Fgitconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0ghny%2Fgitconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0ghny","download_url":"https://codeload.github.com/0ghny/gitconfig/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0ghny%2Fgitconfig/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262335386,"owners_count":23295638,"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":["cli","git","golang"],"created_at":"2025-05-31T02:08:48.596Z","updated_at":"2025-06-27T21:32:32.926Z","avatar_url":"https://github.com/0ghny.png","language":"Go","funding_links":[],"categories":["golang"],"sub_categories":[],"readme":"# gitconfig\n\n\u003e Cli to manage multiple gitconfig with ease\n\n\ngitconfig cli, helps with the tedious management of multiple gitconfig when you need to have different configurations per location. It helps to manage the includeIf sections\n\n```ini\n[includeIf \"gitdir:/a/location/\"]\n    path = /path/to/custom/gitconfig\n```\n\nIt also offers a git config wrapper command so you can get or set configuration properties directly to specific location configurations.\n\n\n## Install\n\nGo to release page, download the binary of your platform / arch and start using it\n\n### Install using asdf\n\nThere's a plugin for asdf to make it easy to use gitconfig.\n\n```shell\n# Having asdf installed and configured in your system\nasdf plugin add gitconfig\nasdf install gitconfig latest\nasdf global gitconfig latest\n```\n\n## Usage\n\n```shell\nManage multiple location based git configurations easily\n\nUsage:\n  gitconfig [command]\n\nAvailable Commands:\n  completion  Generate the autocompletion script for the specified shell\n  config      Executes git config [config-key] [config value] on an specified location\n  help        Help about any command\n  location    Manage a gitconfig location\n  locations   List configured locations\n\nFlags:\n  -c, --git-config string   Git configuration file (default \"/home/user/.gitconfig\")\n  -h, --help                help for gitconfig\n  -v, --verbosity int       Verbosity level from 0 to 4\n      --version             version for gitconfig\n```\n\n### Retrieve current configured locations\n\n```shell\n# It prints all configured locations, in this example, theres only one location\n# with key \"github\" that i use to my github specific configurations like\n# changing user name and email.\n$ gitconfig locations\n\n+---+--------+--------------------------+------------------------------------------+\n| # | KEY    | LOCATION                 | GITCONFIG                                |\n+---+--------+--------------------------+------------------------------------------+\n| 0 | github | /code/                   | /home/user/.gitconfigs/github.gitconfig  |\n+---+--------+--------------------------+------------------------------------------+\n```\n\n### Create a new location config\n\n```shell\n# This creates a new location where you are in git repositories under /code\n# with key \"github\" with the configuration in /home/user/.gitconfigs/github.gitconfig\n\n# We can create it in 2 ways, BEING in the directory /code, or in any other\n# but passing the location pamarater\n\n# Option 1:\n$ cd /code\n$ gitconfig location new --key github\n\n# Options 2:\n$ gitconfig location new --key github --location /code\n\n# If you check your ~/.gitconfig file, it should shown at the very end\n$ cat ~/.gitconfig\n# ...\n# gitconfig.location.key github\n[includeIf \"gitdir:/code/\"]\n    path = /home/user/.gitconfigs/github.gitconfig\n# ...\n```\n\n### Get or Set a configuration property on a location\n\nLike using traditional `git config` command, this is wrapper to allow specify the location configuration file to operate.\nInternally, it just wraps git config but setting environment variable `GIT_CONFIG` to the configured key location.\n\n**Note**: if not --key parameter is provided, it will not pass GIT_CONFIG so will be a regular git config command. It is useful to check git applied configurations as they will be applied when running git commands in your system git commits, pulls, push...\n\n\n```shell\n# Get the user.name property in our recently created location\n# It is getted from a template\n$ gitconfig config --key github user.name\nanonymmous\n\n# Sets a different user name\n$ gitconfig config --key github user.name 0ghny\n# Get the new name\n$ gitconfig config --key github user.name\n0ghny\n\n# Being in /code/repository directory, we can test the git config user.name with gitconfig as\n$ cd /code/repository\n$ gitconfig config user.name\n0ghny\n# 0ghny will be used as your name when operate with git\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0ghny%2Fgitconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0ghny%2Fgitconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0ghny%2Fgitconfig/lists"}