8. GitHub Operation Guide
8.1 Submit code to RUBIK Pi 3
Submit code to RUBIK Pi by submitting a Pull Request (PR). After review, your code may be merged into the RUBIK Pi main branch. The following example shows a method to submit PR to the main branch of RUBIK Pi Linux:
- Log in to GitHub and visit the RUBIK Pi 3 repository https://github.com/rubikpi-ai/linux.
- Click the Fork button and follow the prompts to fork the repository to your own repository.
- Clone the forked repository locally using the
git clone
command.
Use the URL of your own repository.
git clone https://github.com/hongyang-rp/linux.git
- Enter the repository and create a new branch rpdev locally for development.
cd linux
git checkout -b rpdev
- Modify and commit your code.
git add .
git commit -s
- Run the
git push
command to push your local branch to your forked repository on GitHub.
git push --set-upstream origin rpdev
- If the following error occurs when you commit code, a personal token is required.
Method to obtain a personal token:
- Click your GitHub avatar and click Settings.
- Click Developer settings.
- Select Personal access tokens and click Tokens (classic).
- Select Generate new token.
- Configure the token: set a name and choose an expiration time.
It is recommended that you check all the boxes and then click Generate token.
- The following token is generated. Save the token properly.
- Run the
git remote set-url
command to configure the token.
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
-
Replace <your_token> with the token you obtained.
-
Replace <USERNAME> with the GitHub user name.
-
Replace <REPO> with the repository name.
Perform the git push operation. The operation succeeds.
-
Open the browser to visit the repository you forked on GitHub. The following message is prompted. Click Compare & pull request to create a PR as prompted.
Alternatively, click Pull requests and click New pull request to create a PR.
-
Wait for the administrator to view and reply to the PR, and finally merge the PR into the main branch. Click Closed to view PRs merged into the main branch.
If the following message is prompted on the repository you forked, choose Sync fork > Update branch to update the GitHub repository. After the update succeeds, run the git pull
command in the local repository to synchronize the update.
8.2 Create an issue
If you encounter problems during development, find bugs, have comments about RUBIK Pi 3, or want to add features, you can create an issue.
- Log in to GitHub and visit the RUBIK Pi repository, such as https://github.com/rubikpi-ai/linux.
- Click Issues in the upper left corner.
- Before creating an issue, search the issue in the search box to find if someone has already created a similar one. Click New issue and follow the instructions to create an issue.
- Wait for a reply from the community.