Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Repo Sync Tool

This is a Windows-based tool intended to synchronize pairs of repositories between an Original (upstream) and a Bridge (clone) to ensure both remain identical.

Workflow

For each repository pair defined in the CSV, the script performs the following:

  1. Fetch: Pulls latest changes from the Original repo.
  2. Rebase: Re-applies Bridge commits on top of the latest Original commits.
    • Note: If a merge conflict is detected, the script will automatically abort the rebase for that repository and skip to the next one to prevent the script from crashing.
  3. Bridge Update: Pushes the rebased result to the Bridge repo (origin).
  4. Original Update: Pushes the result back to the Original repo (upstream). This ensures the Original repo is updated with any changes made in the Bridge.

Setup

  1. Prerequisites:
    • Existing Repositories: The target repositories must already exist on your Git hosting provider (e.g., GitHub, GitLab, Bitbucket). This tool does not create new repositories.
    • Git: Must be installed and available in your system PATH.
    • Write Access: You must have permissions to push to both the Original and Bridge repositories.
    • Authentication: Ensure SSH keys or credentials are configured for your Git hosting providers.
  2. CSV Configuration: Copy repositories.csv.template to repositories.csv and update it. The columns are:
    • repo_original: URL of the source repository.
    • repo_clone: URL of your bridge repository.
    • branch: The exact branch name to sync (e.g., main, master).

Running the script

The script will create a sync_workdir folder in the tool's directory to handle the cloning and syncing process. Run the script from your terminal using the following command:

powershell -ExecutionPolicy Bypass -File "sync_repos.ps1"

About

A simple tool for windows that updates bridge repositories for developing company code on private machines.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages