-
PRUVOST Florent authored
- add a trick for merge request about fixing issues - add a section rebase on top of master
PRUVOST Florent authored- add a trick for merge request about fixing issues - add a section rebase on top of master
To contribute to the project, you need to do it through merge request
First you need to fork the repository into your own account. You can do that simply by clicking the fork button on the gitlab interface.
https://gitlab.inria.fr/solverstack/chameleon/forks/new
Then, clone the repository on your laptop:
git clone git@gitlab.inria.fr:username/forkname.git
Once this is done, you can setup the chameleon repository as the upstream of your clone to simplify the update of your fork repository.
git remote add upstream git@gitlab.inria.fr:solverstack/chameleon.git
To update your fork with the upstream chameleon’s state:
git pull upstream master
git push -u origin master
Now, you have your repository configured, and you want to create a new pull request. The first step is to create a branch from the HEAD of the your fork repository.
git branch your_branch_name
git checkout your_branch_name
Apply your modifications in your branch. Then, you need to push this branch on your online repository
git push -f origin your_branch_name
or without -f, if the branch already exists online, and you just want to update it.
Once your branch is online, on the gitlab interface, go to the branches webpage, select the branch you want to push as a merge request, and push the button !!!
Be careful to check the ‘close after merge’ check box, and to push to the solverstack/chameleon repository. By default the checkbox may not be checked, and the default repository is your fork.
If the pull request is made to fix an issue, please name the branch “issueXX” so it is automatically linked to the issue. In addition, please add “fix issue #xx” in the comment of the pull request to automatically close the issue when the PR is merged.
Rebase on top of ‘master’
In some cases your “feature” branch you want to merge into “master” has a long life span so that your branch and the master branch could make some conflicts. To avoid having to handle the possible conflicts at merge request time, please rebase your “feature” on top of “master” before pushing the button merge request.
To do that, just go at the HEAD of your “feature” branch and rebase
git checkout feature
git rebase master
Then force to push on your origin
git push --force origin feature
Then push the button merge request.
To review locally a private pull request submitted by someone else
Get the patch from the pull request (Need to update that !!!! Coming from bitbucket)
curl https://bitbucket.org/api/2.0/repositories/icldistcomp/parsec/pullrequests/#PR/patch > pr#PR.patch
Then apply the patch on your local copy
git apply pr#PR.patch