Forking a Repository
Application Scenarios
You can fork a CodeHub repository based on an image repository, make changes to the fork, and merge the changes to the source repository. Before changes are merged, the changes of the fork or the source repository will not affect each other.
As shown in the following figure, fork is applicable to the development scenario where a large-scale project contains multiple sub-projects. The complex development process occurs only in image repositories and the project repository (source repository) is not affected. Only new features that are completed can be merged to the project repository. Therefore, forks can be considered as a team collaboration mode.
Forking a Repository
- Access the repository list page.
- Find the target repository in the repository list, click the repository name to access the repository, and click Fork.
- In the Fork Repository dialog box, select the project to which the fork belongs, and enter the fork name.
If Allow project members to access the repository is selected, the project manager and developers of the project are added to the repository as the administrator and common members of the repository, respectively.
- Click OK to fork the repository. The repository list page is displayed.
Merging Changes of a Fork to the Source Repository
- Access the repository list page.
- Click a forked repository.
- On the Files tab page of the repository, click next to the branch, select Create File from the expanded items, edit the file name and content, and click Save.
- Switch to the Merge Requests tab page.
- Click Create Merge Request. The Create Merge Request page is displayed.
- Source Branch is the one that requests merging.
Target Branch is the one that merges content.
- Click Next. The page for creating a merge request is displayed. The subsequent operation process is the same as that of branch merge review in the repository.
A cross-repository merge request belongs to the source repository and can be viewed only on the Merge Requests tab page of the source repository. Therefore, mergers and reviewers must be members of the source repository.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot