I need to sync github repository (files and commits only) https://github.com/copdips/copdips.github.io to gitee repository https://gitee.com/copdips/copdips.github.io.
- In gitee: create an empty repository, normal the same name as the one you want to sync from github. For example for this blog repository: https://gitee.com/copdips/copdips.github.io
- In gitee: create a PAT in gitee with necessary permissions (
projects). The sync needs to run two commands against to gitee:
git push --all --force gitee
git push --tags --force gitee
- In github repository: create 2 secrets:
- In github repository: create a github workflow, such as: .github/workflows/sync-to-gitee.yml
- In github repository: push the above github workflow file to github, it will automatically trigger the first sync. And from now on, all the pushes to the
mainbranch will trigger a such sync too.
mainis my default branch to trigger the sync, could be changed in the workflow file.
Github action within github free personal plan has a time limit at 2000 minutes per month, which should be enough if you don’t have many repositories and many pushes.