Creating a Proper Pull Request
The steps given below are for the main Redox project - submodules and other projects may vary, though most of the approach is the same.
- In an appropriate directory, e.g.
~/tryredox
, clone the Redox repository to your computer using one of the following commands:
- HTTPS:
git clone https://gitlab.redox-os.org/redox-os/redox.git --origin upstream --recursive
- SSH:
git clone git@gitlab.redox-os.org:redox-os/redox.git --origin upstream --recursive
- Use HTTPS if you don't know which one to use. (Recommended: learn about SSH if you don't want to have to login every time you push/pull!)
- If you used
bootstrap.sh
(see Building Redox), this was done for you and you can skip this step.
- Change to the newly created redox directory and rebase to ensure you're using the latest changes:
cd redox
git rebase upstream master
- Log into Redox Gitlab and fork the Repository. Look for the button in the upper right.
- Add your fork to your list of git remotes with
- HTTPS:
git remote add origin https://gitlab.redox-os.org/MY_USERNAME/redox.git
- SSH:
git remote add origin git@gitlab.redox-os.org:MY_USERNAME/redox.git
- Note: If you made an error in your
git remote
command, usegit remote remove origin
and try again.
- Alternatively, if you already have a fork and copy of the repo, you can simply check to make sure you're up-to-date. Fetch the upstream, rebase with local commits, and update the submodules:
git fetch upstream master
git rebase upstream/master
git submodule update --recursive --init
- Create a separate branch:
git checkout -b MY_BRANCH
- Make your changes.
- Commit:
git add . --all
git commit -m "COMMIT MESSAGE"
- Optionally run rustfmt on the files you changed and commit again if it did anything (check with
git diff
first). - Test your changes with
make qemu
ormake virtualbox
. - Pull from upstream:
git fetch upstream
git rebase upstream/master
- Note: try not to use
git pull
, it is equivalent to doinggit fetch upstream; git merge master upstream/master
, which is not usually preferred for local/fork repositories, although it is fine in some cases.)
- Repeat step 10 to make sure the rebase still builds and starts.
- Push your changes to your fork:
git push origin MY_BRANCH
- On the Redox Gitlab, create a Merge Request, following the template. Describe your changes. Submit!