Skip to content

Configuration

Akash Rajpurohit edited this page Jul 31, 2024 · 19 revisions

Before using git-sync, you need to create a configuration file named config.yaml. The default path for the configuration file is ~/.config/git-sync/config.yaml.

Here's an example configuration file:

# Git Sync Configuration

# Repository settings
include_forks: false # Include forked repositories
include_repos: [] # Include specific repositories
exclude_repos: [] # Exclude specific repositories
include_orgs: [] # Include repositories from specific organizations
exclude_orgs: [] # Exclude repositories from specific organizations

# Authentication
token: <personal_access_token>
username: <username>

# Server settings
backup_dir: /path/to/backup
platform: github
server:
  domain: github.com
  protocol: https
Field Description
username Your GitHub username.
token Your GitHub personal access token. You can create a new token here. Ensure that the token has the repo scope.
include_repos A list of repositories to include in the backup. If set then only these repositories will be backed up.
exclude_repos A list of repositories to exclude from the backup. If set then all repositories except these will be backed up.
include_orgs A list of orgs to include in the backup. If set then repositories only from these organizations will be backed up
exclude_orgs A list of orgs to exclude from the backup. If set then all organization repositories except these orgs will be backed up.
backup_dir The directory where the repositories will be backed up. Default is ~/git-backups.
include_forks If set to true, forks of the user's repositories will also be backed up. Default is false.
platform The platform to use for syncing repositories. Currently only supports github.
server The server settings. This includes the domain and the protocol which is http or https

Note: The include_repos, exclude_repos, include_orgs and exclude_orgs fields accept repository/organization name as well as glob patterns. The patterns supported are those defined by filepath.Match.

Clone this wiki locally