Handle commit conflicts
Less than 1 minuteAbout 190 words
Handle commit conflicts
If you find that the submitted PR has the following marks, it means that there is a conflict between the PR you submitted and your local, and you need to deal with the conflict.
Copy the remote warehouse to the local
Execute the copy command on the local computer:
# Copy the remote fork repository to the local
git clone https://github.com/$user_name/openGemini.git
# Set the upstream source of the local working directory (forked upstream repository)
git remote add upstream https://github.com/openGemini/openGemini.git
# Set the synchronization method, here
git remote set-url --push upstream no_push
Keep your branch in sync with main
git checkout main
git fetch upstream
git rebase upstream/main
Then switch the branch to the branch you are using, and start rebase
git checkout your branch
git rebase main
At this point, you can see the conflict prompt on git, and you can check the conflict through tools such as vi
After the conflict is resolved, submit the modification
git add .
git rebase --continue
git push -f origin yourbranch