Skip to content

Conversation

CongkaiTan
Copy link
Contributor

@CongkaiTan CongkaiTan commented Aug 8, 2025

Issue #, if available:
This change aims to use the repo-sync tool to keep the two repos in sync

Description of changes:

Following the instructions listed in the repo-sync's official guide, as well as the actual implementation in the GitHub Docs repo, to create the repo-sync.yml file that defines the sync workflow:

  • It runs once per day (we can change it to a higher frequency if needed)
  • When new changes had been made to a repo before a run, it publishes and merges a PR

The commit history, including each commit's SHA, of the two repos will be kept exactly the same.

The secrets used by the workflow will be created in the next step.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@CongkaiTan CongkaiTan requested a review from a team as a code owner August 8, 2025 05:20
@AWSjswinney
Copy link

Does this cherry pick commits or does it merge them? I'd really prefer that we merge from one to the other so that developers can use one clone with remotes for both destinations.

@CongkaiTan
Copy link
Contributor Author

Does this cherry pick commits or does it merge them? I'd really prefer that we merge from one to the other so that developers can use one clone with remotes for both destinations.

Great callout. repo-sync merges the commits onto an intermediate branch, and up to this point the history is completely in sync with the source repo. However, the commits will need to be merged to main through a PR, and that's where the issues occur.

Based on a few experiments and researches, it seems through GitHub UI we can't merge the PR while keeping the history completely in sync. If we do plain merge, the original commits are left intact but we get an extra merge commit; If we do rebase, unfortunately the commits are reapplied, meaning they are essentially different commits with different checksums.

This'll also mess up the two-way auto sync, since it requires commit histories of the two repos to be exactly the same. I'll need to dig deeper and find a solution.

@CongkaiTan CongkaiTan force-pushed the CongkaiTan-personal branch from 6b45cb0 to 49dc4f3 Compare August 10, 2025 00:16
@CongkaiTan CongkaiTan changed the title Create repo-sync.yml to enable repo-sync between the public and private repo Create repo-sync.yml to enable repo-sync between repos Aug 11, 2025
@CongkaiTan CongkaiTan force-pushed the CongkaiTan-personal branch from 49dc4f3 to 1cad04f Compare August 11, 2025 17:48
@CongkaiTan CongkaiTan force-pushed the CongkaiTan-personal branch from 1cad04f to 26cdf25 Compare August 12, 2025 22:05
@CongkaiTan CongkaiTan merged commit e5313e2 into main Aug 13, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants