8000 Configuration · AkashRajpurohit/git-sync Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Configuration

Akash Rajpurohit edited this page Mar 14, 2025 · 21 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_wiki: true # Include wiki's
include_repos: [] # Include specific repositories
exclude_repos: [] # Exclude specific repositories
include_orgs: [] # Include repositories from specific organizations
exclude_orgs: [] # Exclude repositories from specific organizations
raw_git_urls: [] # Raw valid git URLs

# Authentication
username: <username>
tokens: [<token 1>]

# Server settings
backup_dir: /path/to/backup
clone_type: bare # Clone type: bare, shallow, mirror or full. Default: bare
cron: 0 0 * * * # run every 24 hours at 00:00
concurrency: 5
retry:
  count: 3
  delay: 10 # in seconds
platform: github
server:
  domain: github.com
  protocol: https
notification:
  enabled: true
  only_failures: false
  ntfy:
    topic: 'backup'
    server: 'https://ntfy.sh' # Optional
    username: 'akash' # Optional
    password: 'password' # Optional
    priority: 4 # Optional (1-5)
    tags: ['backup'] # Optional
  gotify:
    url: 'http://localhost:2444'
    app_token: 'your_app_token'
    priority: 4 # Optional (1-5)
Field Description Required
username Your service username. Yes
tokens List of service personal access token. You can create a new token here. Ensure that the token has the repo scope. Yes
backup_dir The directory where the repositories will be backed up. Yes (For initial config, the suggested path is set to ~/git-backups)
platform The platform to use for syncing repositories. Currently, it supports github, gitlab, bitbucket, gitea or forgejo. Yes (But you can skip this when passing raw_git_urls)
include_wiki Include wiki in your backup process along with the code. No (Default is true)
include_forks If set to true, forks of the user's repositories will also be backed up. Default is false. No (Default is false)
include_repos A list of repositories to include in the backup. If set then only these repositories will be backed up. No (Default is [])
exclude_repos A list of repositories to exclude from the backup. If set then all repositories except these will be backed up. No (Default is [])
include_orgs A list of orgs to include in the backup. If set then repositories only from these organizations will be backed up No (Default is [])
exclude_orgs A list of orgs to exclude from the backup. If set then all organization repositories except these orgs will be backed up. No (Default is [])
raw_git_urls A list of raw git URLs to sync No (Default is [])
cron The cron expression to run the sync job periodically. No (Default is "")
concurrency Number of repos being synced concurrently. No* (Default is "5")
clone_type The type of clone you want to perform. Options are: bare, shallow, mirror or full No* (Default is bare)
retry The retry config. Allows user's to set a retry count and delay to auto-retry the failures during sync operations. No
server The server settings. This includes the domain and the protocol which is http or https. This is helpful if you are self hosting your git server. No
workspace The workspace name. Yes (only if the platform is bitbucket)
notification Notification config, more details can be seen from the above sample configuration No

'*' means that currently it is not required while we are before v1 release to maintain backward compatibility, but that can change after v1 release.

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.

Here are some examples you can see for different configurations

Clone this wiki locally
0