{"id":20779072,"url":"https://github.com/jjwizardmp/git-switcher","last_synced_at":"2026-04-13T04:02:14.575Z","repository":{"id":156560397,"uuid":"489841995","full_name":"JJWizardMP/Git-Switcher","owner":"JJWizardMP","description":"Bash Script Project for Switch Git and Github Accounts","archived":false,"fork":false,"pushed_at":"2023-02-01T06:54:56.000Z","size":2031,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T08:37:22.558Z","etag":null,"topics":["bash","git","github-cli","jq","json","shell","shell-scripts"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JJWizardMP.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-08T04:08:15.000Z","updated_at":"2022-05-09T00:07:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad61ee71-44e0-479f-b096-844e03da59d4","html_url":"https://github.com/JJWizardMP/Git-Switcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJWizardMP%2FGit-Switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJWizardMP%2FGit-Switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJWizardMP%2FGit-Switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJWizardMP%2FGit-Switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JJWizardMP","download_url":"https://codeload.github.com/JJWizardMP/Git-Switcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243119537,"owners_count":20239321,"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":["bash","git","github-cli","jq","json","shell","shell-scripts"],"created_at":"2024-11-17T13:25:53.850Z","updated_at":"2025-12-26T04:32:29.348Z","avatar_url":"https://github.com/JJWizardMP.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Git and Github Switcher Credentials\n\n![](https://i.ytimg.com/vi/PPQ8m8xQAs8/maxresdefault.jpg)\n\n## Introduction\n\nI wanted to create this script for to switch my git accounts(from the work, university and my personal account) easier only running a bash script.\n\nI used these shell command line tools in this project:\n\n- jq: a shell command line for read easily a json file.\n- git: a shell command line for manage a control of versions for software projects.\n- github-cli: a shell command line for \nconnect with the github page repository.\n\n## Requeriments\n\n- Write a bash script that allows switch git and github accounts.\n\n## Demo\n\n- [Repository](https://github.com/JJWizardMP/Git-Switcher)\n\n## Images\n\n### Typing command line script\n\n![Before Running](./assets/views/example-before-running.png)\n\n### Running script\n\nShowing current credentials:\n![Script Running 1](./assets/views/example-running-current-credentials.png)\nShowing new credentials: \n![Script Running 2](./assets/views/example-running-new-credentials.png)\n\n## Technologies\n\n#### Command line\n\n| [jq](https://stedolan.github.io/jq/) | [Git](https://git-scm.com/) | [Github-cli](https://cli.github.com/) |\n| :----------------------------------: | :-------------------------: | :-----------------------------------: |\n\n## Application Installation\n\n### Git Switcher:\n\nWe need to assing permisions for run the requirements intaller script and the main script(Do not forget config your config.json and add your credentials).\n\n```sh\n$ chmod u+x script.sh requirements.sh\n```\n\nRun the requirements script with one argument(the argument is your operating system).\n\nArguments:\n- system: \"mac\" or \"linux\"\n\n```sh\n$ ./requirements.sh linux\n```\n\nRun the main script but first we need to specify 2 arguments, the third argument is optional only if you pass \"github\" or \"both\" as the first argument, in other case is not necessary.\n\nArguments:\n- command: \"git\", \"github\" or \"both\"\n- account: name of account in the config.json\n- method: \"token\" or \"browser\"\n\n\n```sh\n$ ./script.sh both jjwizard browser\n```\n\n## Aditional Recommendation \n\nif you use visual code as your IDE, we recommend use the browser auth mode because you log in github-cli and github page in your default browser(Be sure you are logout of github in your browser), if you use token auth, you only log in github-cli.\n\n## Contributors\n\nThis project was written by:\n\n- Programmer :\n  - [Joan de Jesús Méndez Pool](https://github.com/JJWizardMP)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjwizardmp%2Fgit-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjwizardmp%2Fgit-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjwizardmp%2Fgit-switcher/lists"}