Skip to content

Instantly share code, notes, and snippets.

@Urpagin
Created July 19, 2025 21:47
Show Gist options
  • Select an option

  • Save Urpagin/a31fcefc1226336954dae75dac56e1bb to your computer and use it in GitHub Desktop.

Select an option

Save Urpagin/a31fcefc1226336954dae75dac56e1bb to your computer and use it in GitHub Desktop.
Forgejo - GitHub Repo Mirroring Script
#!/usr/bin/env bash
t='<FORGEJO API KEY>'
u='<FORGEJO_URL_WITH_PORT>' # e.g., http://localhost:3000
curl -X POST $u/api/v1/repos/migrate \
-H "Authorization: token $t" \
-H "Content-Type: application/json" \
-d '{
"clone_addr": "<GITHUB URL>",
"repo_name": "<REPO NAME>",
"repo_owner": "<FORGEJO USERNAME>",
"mirror": true,
"private": false,
"service": "github",
"issues": true,
"pull_requests": true,
"milestones": true,
"labels": true,
"wiki": true,
"releases": true
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment