This guide is intended for maintainers of both the GitLab and GitHub repositories. The GitHub repository (<remote>
) serves as the primary codebase, while the GitLab repository (origin
) is the secondary repository. However, due to JATIC program requirements, primary development must occur on GitLab. This process provides a workaround to ensure that GitHub (<remote>
) remains the primary codebase while complying with development requirements on GitLab.
-
Clone the Repository Clone the repository from GitLab (this will be your
origin
remote):git clone [email protected]:jatic/kitware/xaitk-saliency.git
This step only needs to be done once.
-
Add Upstream Remote Repository Add the GitHub repository as an upstream remote repository named
<remote>
:git remote add <remote> [email protected]:XAITK/xaitk-saliency.git
This step only needs to be done once.
-
Sync Local Branch Ensure your local branch
main
is up-to-date withorigin/main
:git fetch origin git checkout main git pull origin main
-
Push to Remote Repository Push your
main
branch to the<remote>
remote:git push <remote> main
-
Create a Pull Request Open a pull request from
main
to the target branch on the<remote>
remote repository. -
Follow Contribution Guidelines Refer to CONTRIBUTING.md for details on pull request code reviews and merging.
-
Mirror Updates to Origin Ensure
origin/master
mirrors<remote>/master
.This process happens automatically but may take a few minutes to reflect changes.
-
Update Local Master Branch Sync your local
master
branch withorigin/master
:git fetch origin git checkout master git pull origin master
-
Switch to Main Check out your
main
branch:git checkout main
-
Rebase Master onto Main Rebase
<remote>
ontomain
:git rebase master
-
Push Main to Origin Push the updated
main
branch back to theorigin
remote:git push origin main