Synchronizing a Forked Repository

The synchronize operation pulls all the changes from the parent repository to the forked repository.

    1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
    2. Select a project and from the left-side menu, click Code Repositories.
    3. Select a forked code repository and then click the Synchronize Fork button on the Repository details page.
    4. Select one of the synchronization strategies:
      1. Merge: Changes in the parent repository are merged into the forked repository. If any conflict exists, then the sync operation fails. You must resolve the conflicts manually using Git CLI commands.
      2. Discard: Changes in the parent repository are merged into the forked repository, and changes in the forked repository are discarded. If there were conflicts during a merge, and you don't want to keep the changes, then you can use the discard strategy to sync the fork branch.
    5. Click Update branch.
  • To synchronize a forked repository, run the sync command:

    oci devops repository sync

    Required parameters are:

    • --destination-branch
    • -repository-id
    • --source-branch
    • --sync-merge-strategy

      sync_merge_strategy must be either FETCH_AND_MERGE or DISCARD

      .

    To compare fork branch with the parent branch run the get-commit-diff command:

    oci devops repository get-commit-diff

    Required parameters are:

    • -repository-id
    • --target-version
    • --target-repository-id.

    To get all the commands for repository:

    oci devops repository -h
  • To synchronize a forked repository, use the SyncRepository operation.