Skip to content

xbglowx/github-org-repos-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-org-repos-sync Build and Test golangci-lint CodeQL

Sync GitHub organization repos

Build

  1. git clone git@github.com:xbglowx/github-org-repos-sync.git
  2. go get -d .
  3. go build .

Auth

  1. Authenticated access to the GitHub API via personal access token with scope repo
    • export GITHUB_TOKEN=<token>
  2. git cli authenticated to GitHub

How It Works

  1. Generates a list of repos the caller has access to within the specified organization
  2. Clones each repo if it doesn't exist locally in the destionation path
  3. If the repo already exists:
    1. Switches to the default branch, only if the current branch is clean; Stashes if dirty
    2. Updates

Usage

  1. ./github-org-repos-sync --help