Synchronizing a Forked Repository
The synchronize operation pulls all the changes from the parent repository to the forked repository.
- Open the navigation menu and click Developer Services. Under DevOps, click Projects.
- Select a project and from the left-side menu, click Code Repositories.
- Select a forked code repository and then click the Synchronize Fork button on the Repository details page.
-
Select one of the synchronization strategies:
- 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.
- 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.
- Click Update branch.
To synchronize a forked repository, run the
synccommand:oci devops repository syncRequired parameters are:
--destination-branch-repository-id--source-branch--sync-merge-strategy
.sync_merge_strategymust be eitherFETCH_AND_MERGEorDISCARD
To compare fork branch with the parent branch run the
get-commit-diffcommand:oci devops repository get-commit-diffRequired parameters are:
-repository-id--target-version--target-repository-id.
To get all the commands for
repository:oci devops repository -hTo synchronize a forked repository, use the
SyncRepositoryoperation.