Skip to content

Useful guide for making PR

Alberto Pérez de Rada Fiol edited this page Apr 6, 2017 · 3 revisions

In this page, you will find a guide on how to create a PR for a translation of the Regulations.

All this commands are ran from the Terminal.

Before beginning, you will need to install pip:

sudo apt install python-pip
pip install --upgrade pip

And the WRC package:

pip install wrc

How to create the PR

First, we need to download the repository to our computer:

git clone https://github.com/thewca/wca-regulations-translations.git
cd wca-regulations-translations/

git remote add thewca https://github.com/thewca/wca-regulations-translations
git remote --list
git remote -v

Now, we create a new branch ("Italian"):

git checkout -b Italian

You can check the branch you are on running the command: git branch

While we are on the new branch, we copy the files (mind the names) with the updated translation into his folder:

cp ../wca-*.md italian/
cd italian/
git status
git diff

Now, we open the regulations and the guidelines files to fix whatever is needed to be fixed:

gedit wca-*.md &
git diff

wrc --target=check wca-regulations.md
wrc --target=check wca-guidelines.md

We move back to the translations directory and clone the repository of the official regulations:

cd ..
git clone https://github.com/thewca/wca-regulations.git
cd wca-regulations-translations/

And we check if the regulations are correct:

wrc italian/ --diff ../wca-regulations
git add -p
git status

We have done all the work locally, now we want to commit those changes to the server:

First, we log in*:

git config --global user.name "AlbertoPdRF"
git config --global user.email "[email protected]"

And now we commit the changes:

git commit
git log
git push thewca Italian:AlbertoPdRF-UpdateItalian (If the branch AlbertoPdRF-UpdateItalian wasn't created, what should we have done?)
git push thewca Italian:AlbertoPdRF-UpdateItalian --force

And your PR is created!

*You may want to create a ssh-keygen instead of log in every time:

cd
ssh-keygen
gedit /home/alberto/.ssh/id_rsa.pub &

Now you have to go to "GitHub->Settings->SSH and GPG keys->New SSH key" and copy the text on "id_rsa.pub" there.

You just need to go back to your working directory (cd Descargas/wca-regulations-translations/) and get back to work :)

Clone this wiki locally