Skip to content

Examples

Akash Rajpurohit edited this page Apr 21, 2025 · 15 revisions

Basic Configurations

GitHub

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: []
include_orgs: []
exclude_orgs: []
raw_git_urls: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
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)

GitLab

username: your-gitlab-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: []
include_orgs: []
exclude_orgs: []
raw_git_urls: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
concurrency: 5
retry:
  count: 3
  delay: 10 # in seconds
platform: gitlab
server:
  domain: gitlab.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)

Gitea

username: your-gitea-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: []
include_orgs: []
exclude_orgs: []
raw_git_urls: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
concurrency: 5
retry:
  count: 3
  delay: 10 # in seconds
platform: gitea
server:
  domain: gitea.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)

Forgejo

username: your-forgejo-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: []
include_orgs: []
exclude_orgs: []
raw_git_urls: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
concurrency: 5
retry:
  count: 3
  delay: 10 # in seconds
platform: forgejo
server:
  domain: codeberg.org
  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)

BitBucket

username: your-bitbucket-username
tokens: [your-app-password]
workspace: you-bitbucker-workspace
include_wiki: true
include_repos: []
exclude_repos: []
include_orgs: []
exclude_orgs: []
raw_git_urls: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
concurrency: 5
retry:
  count: 3
  delay: 10 # in seconds
platform: bitbucket
server:
  domain: bitbucket.org
  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)

NOTE: For BitBucket you need to also add the workspace key which is not required for GitHub or GitLab

Example configurations for different use-cases

Run the git-sync with cron (Ideal situation for Docker users)

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: []
include_orgs: []
exclude_orgs: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
concurrency: 5
retry:
  count: 3
  delay: 10 # in seconds
cron: * * * * *
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)

Include all repositories that I own (even forks)

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: []
include_orgs: []
exclude_orgs: []
backup_dir: /path/to/backup
include_forks: true
clone_type: bare
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)

Include all repositories that I own excluding forks

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: []
include_orgs: []
exclude_orgs: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
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)

Include all repositories that I own excluding forks and some repositories

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: ["repo1", "repo2"]
include_orgs: []
exclude_orgs: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
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)

Include only specific repositories

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: ["repo1"]
exclude_repos: []
include_orgs: []
exclude_orgs: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
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)

NOTE: In the above example if you passed exclude_repos as well then it will be ignored since you have passed include_repos. So an example like below will still have the same effect as above and only "repo1" will be backed up.

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: ["repo1"]
exclude_repos: ["repo2", "repo3"]
include_orgs: []
exclude_orgs: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
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)

Include / Exclude repositories only from specific organizations

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: []
include_orgs: ["org1", "org2"]
exclude_orgs: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
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)

Similarly, you can exclude repositories from specific organizations:

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: []
include_orgs: []
exclude_orgs: ["org1", "org2"]
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
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)

NOTE: When you are using exclude_orgs option, it means that all organization repositories from the organizations mentioned in the list will be excluded from the backup. If you want to exclude only specific repositories from the organizations then you can use exclude_repos option.

Include / Exclude repositories using glob patterns

To include all repos which start with repo, you can use the following configuration:

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: ["repo*"]
exclude_repos: []
include_orgs: []
exclude_orgs: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
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)

Same way, you can exclude all repos which start with repo:

username: your-github-username
tokens: [your-personal-access-token]
include_wiki: true
include_repos: []
exclude_repos: ["repo*"]
include_orgs: []
exclude_orgs: []
backup_dir: /path/to/backup
include_forks: false
clone_type: bare
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)

Include Raw Git URLs

raw_git_urls: ['https://github.com/selfhst/icons']
backup_dir: /path/to/backup
clone_type: full
concurrency: 5
retry:
  count: 3
  delay: 10 # in seconds
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)