{"id":17497312,"url":"https://github.com/moox/git-init","last_synced_at":"2025-09-14T03:28:35.011Z","repository":{"id":66070838,"uuid":"136129705","full_name":"MoOx/git-init","owner":"MoOx","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-05T06:26:14.000Z","size":2,"stargazers_count":32,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-21T11:11:50.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/MoOx.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},"funding":{"github":"MoOx","ko_fi":"moox__","liberapay":"MoOx","custom":"https://www.paypal.com/paypalme/MoOx"}},"created_at":"2018-06-05T06:19:48.000Z","updated_at":"2023-05-29T19:29:04.000Z","dependencies_parsed_at":"2023-02-20T19:30:54.203Z","dependency_job_id":null,"html_url":"https://github.com/MoOx/git-init","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MoOx/git-init","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fgit-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fgit-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fgit-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fgit-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoOx","download_url":"https://codeload.github.com/MoOx/git-init/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fgit-init/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275057499,"owners_count":25398079,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-19T15:40:58.606Z","updated_at":"2025-09-14T03:28:34.972Z","avatar_url":"https://github.com/MoOx.png","language":null,"funding_links":["https://github.com/sponsors/MoOx","https://ko-fi.com/moox__","https://liberapay.com/MoOx","https://www.paypal.com/paypalme/MoOx"],"categories":[],"sub_categories":[],"readme":"# git-init\n\n[![Repo on GitHub](https://img.shields.io/badge/repo-GitHub-3D76C2.svg)](https://github.com/MoOx/git-init)\n[![Repo on GitLab](https://img.shields.io/badge/repo-GitLab-6C488A.svg)](https://gitlab.com/MoOx/git-init)\n[![Repo on BitBucket](https://img.shields.io/badge/repo-BitBucket-1F5081.svg)](https://bitbucket.org/MoOx/git-init)\n\n\u003e Keep in sync your Git repos on GitHub, GitLab \u0026 Bitbucket without efforts\n\n**Once** Install some CLI tools\n\n```console\nbrew install hub\ngem install gitlab\npip install bitbucket-cli\n```\n\nNote: be sure to have tokens as env var, see the beginning of this post for\ndetails.\n\n(Also, configure a git alias that will do `pull --all` if you want to pull all\nremote by default.)\n\n### For each repos\n\n1.  Export your username (assuming you have the same on all platforms)\n\n```console\nexport GIT_USER_NAME=$USER\n```\n\n2.  For new repo (if your repo already exist on GitHub, go to step below.)\n\n```console\nexport GIT_REPO_NAME=your-repo\nmkdir $GIT_REPO_NAME \u0026\u0026 cd $GIT_REPO_NAME\ngit init\nhub create\n```\n\n3.  For existing GitHub repo\n\n```console\nexport GIT_REPO_NAME=$(basename $(pwd))\ngitlab create_project $GIT_REPO_NAME \"{visibility_level: 20}\"\nbb create --protocol=ssh --scm=git --public $GIT_REPO_NAME\n```\n\nThen, to add remotes\n\n```\ngit remote set-url origin --add https://gitlab.com/${GIT_USER_NAME}/${GIT_REPO_NAME}.git\ngit remote set-url origin --add https://bitbucket.org/${GIT_USER_NAME}/${GIT_REPO_NAME}.git\ngit remote add origin-gitlab https://gitlab.com/${GIT_USER_NAME}/${GIT_REPO_NAME}.git\ngit remote add origin-bitbucket https://bitbucket.org/${GIT_USER_NAME}/${GIT_REPO_NAME}.git\n```\n\n4.  Check that everything is ok\n\n```console\ngit remote -v\n```\n\nYou should get something like\n\n```\norigin  ssh://git@github.com/YOU/YOUR-REPO.git (fetch)\norigin  ssh://git@github.com/YOU/YOUR-REPO.git (push)\norigin  ssh://git@gitlab.com/YOU/YOUR-REPO.git (push)\norigin  ssh://git@bitbucket.org/YOU/YOUR-REPO.git (push)\norigin-bitbucket        ssh://git@bitbucket.org/YOU/YOUR-REPO.git (push)\norigin-bitbucket        ssh://git@bitbucket.org/YOU/YOUR-REPO.git (fetch)\norigin-gitlab   ssh://git@gitlab.com/YOU/YOUR-REPO.git (fetch)\norigin-gitlab   ssh://git@gitlab.com/YOU/YOUR-REPO.git (push)\n```\n\n😇 Now you can just `git push` and `git pull --all`!\n\n## Bonus: badges\n\nYou can add some nices badges to show the redundancy on your project README\n\n```markdown\n[![Repo on GitHub](https://img.shields.io/badge/repo-GitHub-3D76C2.svg)](https://github.com/YOU/YOUR-REPO)\n[![Repo on GitLab](https://img.shields.io/badge/repo-GitLab-6C488A.svg)](https://gitlab.com/YOU/YOUR-REPO)\n[![Repo on BitBucket](https://img.shields.io/badge/repo-BitBucket-1F5081.svg)](https://bitbucket.org/YOU/YOUR-REPO)\n```\n\n**Adjust `YOU/YOUR-REPO` to your need in the markdown**.\n\nIt will look like this\n\n[![Repo on GitHub](https://img.shields.io/badge/repo-GitHub-3D76C2.svg)](https://github.com/YOU/YOUR-REPO)\n[![Repo on GitLab](https://img.shields.io/badge/repo-GitLab-6C488A.svg)](https://gitlab.com/YOU/YOUR-REPO)\n[![Repo on BitBucket](https://img.shields.io/badge/repo-BitBucket-1F5081.svg)](https://bitbucket.org/YOU/YOUR-REPO)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoox%2Fgit-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoox%2Fgit-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoox%2Fgit-init/lists"}