{"id":25914483,"url":"https://github.com/michaelbolanos/github-sync","last_synced_at":"2026-04-11T00:55:51.121Z","repository":{"id":279855406,"uuid":"940211349","full_name":"michaelbolanos/github-sync","owner":"michaelbolanos","description":"Sync your GitHub repos from the Linux CLI under ","archived":false,"fork":false,"pushed_at":"2025-02-27T20:20:39.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T04:56:56.606Z","etag":null,"topics":["automation","bash","bash-script","dev-tools","git","git-automation","github-sync","linux","open-source","productivity","sysadmin"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/michaelbolanos.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":"2025-02-27T19:46:03.000Z","updated_at":"2025-02-27T20:25:27.000Z","dependencies_parsed_at":"2025-02-28T04:56:58.686Z","dependency_job_id":"9a7b8853-6606-488b-a328-21b4f0f9dd9c","html_url":"https://github.com/michaelbolanos/github-sync","commit_stats":null,"previous_names":["michaelbolanos/github-sync"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbolanos%2Fgithub-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbolanos%2Fgithub-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbolanos%2Fgithub-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbolanos%2Fgithub-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelbolanos","download_url":"https://codeload.github.com/michaelbolanos/github-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241652964,"owners_count":19997578,"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":["automation","bash","bash-script","dev-tools","git","git-automation","github-sync","linux","open-source","productivity","sysadmin"],"created_at":"2025-03-03T11:20:55.897Z","updated_at":"2025-12-31T01:03:26.101Z","avatar_url":"https://github.com/michaelbolanos.png","language":"Shell","readme":"# GitHub Sync Script\n\n## Overview\n\n`github-sync.sh` is a powerful and interactive Bash script that automates syncing and managing Git repositories under your `~/scripts` directory. It helps you stay in sync with GitHub through SSH authentication, GitHub API integration, and an interactive menu.\n\n---\n\n## Features\n\n- ✅ **SSH Key Setup** – Generates an SSH key if missing and prompts you to add it to GitHub.\n- 🔁 **Auto-Sync Repos** – Automatically fetches, stashes, pulls, commits, and pushes repos.\n- 🌐 **GitHub API Integration** – Uses your GitHub token to fetch and clone all your repos.\n- 📦 **Auto Backup** – Archives each repo before syncing.\n- 🎨 **Color UI + Alerts** – Color-coded output with terminal sound notifications.\n- 🔍 **Interactive Menu** – Sync all, selected, or one repo; clone manually or via API.\n- 📜 **Logging** – All actions logged to `~/scripts/github-sync.log`.\n\n---\n\n## Prerequisites\n\n- ✅ Linux/macOS terminal with Bash\n- ✅ `git`, `curl`, and `ssh` installed\n- ✅ GitHub account\n\n---\n\n## First-Time Setup (SSH + Token)\n\n### 🔑 1. Generate an SSH Key\n\n#### ⚙️ Default (RSA):\nThe script auto-generates this if no key is found:\n```bash\nssh-keygen -t rsa -b 4096 -C \"you@example.com\"\n```\n\n#### 🔐 Modern Option (ECDSA):\nFor a smaller, faster, modern key:\n```bash\nssh-keygen -t ecdsa -b 521 -C \"you@example.com\" -f ~/.ssh/id_ecdsa\n```\n\nThen add it to your ssh-agent:\n```bash\neval \"$(ssh-agent -s)\"\nssh-add ~/.ssh/id_ecdsa\n```\n\nUpdate your GitHub SSH key accordingly.\n\n---\n\n### 🔗 2. Add SSH Key to GitHub\n\nCopy your public key:\n```bash\ncat ~/.ssh/id_rsa.pub   # or id_ecdsa.pub if using ECDSA\n```\n\nThen go to: [https://github.com/settings/keys](https://github.com/settings/keys)  \nClick **New SSH key**, paste it in, and save.\n\n---\n\n### 🔐 3. Create GitHub Personal Access Token (for API)\n\nGo to: [https://github.com/settings/tokens](https://github.com/settings/tokens)\n\nClick **Generate new token (classic)**  \n✅ Select scopes:\n- `repo`\n- `read:user`\n\nCopy the token (you’ll need it for the script's \"Clone from GitHub Account\" option).\n\n---\n\n## Installation\n\n```bash\ngit clone git@github.com:michaelbolanos/github-sync.git\ncd github-sync\nchmod +x github-sync.sh\n```\n\nOptional (run globally):\n\n```bash\nsudo mv github-sync.sh /usr/local/bin/github-sync\n```\n\n---\n\n## Usage\n\n```bash\n./github-sync.sh\n```\n\nOr globally:\n\n```bash\ngithub-sync\n```\n\n---\n\n## Menu Options\n\n1. **Sync All** – Sync all repos in `~/scripts`\n2. **Sync Selected Repos** – Pick specific ones to sync\n3. **Sync One Repo** – Enter a path manually\n4. **Clone Repos Manually** – Paste SSH URLs one by one\n5. **Clone from GitHub Account** – Enter GitHub username and token to clone and sync all repos\n6. **View Log** – Show sync logs\n7. **Exit** – Exit script\n\n---\n\n## Merge Conflict Handling\n\nIf you see:\n\n```\n⚠️ Merge conflict detected! Resolve manually and re-run the script.\n```\n\nRun:\n```bash\ngit status\ngit mergetool\ngit rebase --continue\n```\n\nThen re-run the script.\n\n---\n\n## License\n\nMIT License – see `LICENSE`.\n\n---\n\n## Contributions\n\nFork the repo, suggest changes, and submit PRs.\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelbolanos%2Fgithub-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelbolanos%2Fgithub-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelbolanos%2Fgithub-sync/lists"}