Sync your fork from the terminal

sidmohanty11

Sidharth Mohanty

Posted on March 16, 2024

Sync your fork from the terminal

As a collaborator on GitHub projects who heavily relies on forks, I found myself performing a repetitive task every morning: syncing my forks with the parent repositories to stay up-to-date. This manual 3-step process of navigating GitHub, checking for updates, and syncing felt like an everyday chore.

Being a developer, I decided to automate this!

Introducing syncb, a simple script that streamlines your workflow with a single command. With syncb, you can effortlessly sync both public and private forks, saving you valuable time and frustration.

syncb

Getting Started

Install syncb globally using npm:

npm i -g syncb
Enter fullscreen mode Exit fullscreen mode

Run syncb in your terminal.

That's it! syncb seamlessly syncs your repository with the latest commits from the parent repository.

Using Private Forks

Initially, I encountered authorization issues (401 errors) when syncing private forks. To overcome this, you can securely store a GitHub Personal Access Token (PAT) with repo access in your environment variable as GITHUB_TOKEN (e.g., .zshrc). syncb will automatically leverage this token for private repo syncing.

Share and Contribute!

Did syncb make your life easier? Share it with a star ⭐ on the repository! Additionally, I'd love to hear your preferred fork syncing methods – perhaps you have a more efficient approach? Feel free to contribute to the project as well!

Connect with me!

Visit sidharthmohanty.com to stay connected.

💖 💪 🙅 🚩
sidmohanty11
Sidharth Mohanty

Posted on March 16, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related