From fd95c7027d724e07947d490f72144147f63a7da8 Mon Sep 17 00:00:00 2001 From: Lukas Brabec Date: Mar 29 2021 15:45:08 +0000 Subject: add 'how to do pull requests' to README.md --- diff --git a/README.md b/README.md index fe796dc..9148773 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,66 @@ The landingpage is now running at * Read [the UX feedback](https://docs.google.com/document/d/13scGRYzlI2bs9LUmi_sydfa5pqIZ5RX_uFo4IJC--II/edit?usp=sharing ) * Try Fedora QA Dashboard yourself, clone the repo, browse the code, try to do a small change and see the results. If you want to start contributing to this project, look for issues tagged "easyfix". + +### How to do pull requests + +* create an account on Pagure, don't forget to add your public ssh key to Pagure (click on your avatar > My settings > SSH Keys > Add SSH key) + +* fork this repository (upper right corner) + +* clone your forked repo using SSH option + +* add our repo as upstream remote +``` +$ git remote add upstream https://pagure.io/fedora-qa/landingpage.git +``` + +* to get the latest commit from our branch do (you'll need this later): +``` +$ git checkout master +$ git fetch upstream/master +$ git rebase upstream/master +``` + +* it is a good practise to create separate branch for each feature or fix you are going to do: +``` +$ git checkout -b +``` + +* once you are done coding, commit your changes and push them, use `git diff` and `git status` to see if you haven't changed anything else by accident; the first time you push your branch to origin use this command: +``` +$ git push -u origin +``` + +* create pull request, provide description or at least link to an issue. + +* you will probably add several more commits after the feedback from pull request review, in the end squash those commits to one, you will need a hash of a commit that is before the commits you want to squash : +``` +$ git log +commit + your change 3 + +commit + your change 2 + +commit + your change 1 + +commit + you want to use hash of this commit + + +$ git rebase -i +``` + +* if you squashed commits, you'll have to do force push: +``` +$ git push -f +``` + +* it is possible that there have been changes in our `master` meanwhile, or you simply forgot to fetch changes before you started, you'll have to fetch new changes (see above), checkout to your branch and rebase your branch: +``` +$ git rebase master +``` + +* when rebasing, there might be conflicts you'll have to resolve