Skip to content

Commit 69bcd62

Browse files
authored
add update instructions to README.md
1 parent 1625c57 commit 69bcd62

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed

README.md

+112
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,115 @@ We believe solving code challenges is a very effective way to achieve this. Good
1717
Keep Calm and Code in Python!
1818

1919
Bob and Julian @ [PyBites](http://pybit.es)
20+
21+
## To follow along with our challenges
22+
23+
## I. First time around
24+
25+
* Make your own fork of our [challenges repo](https://github.com/pybites/challenges): use the Fork button at the top right of the page.
26+
27+
* Clone your copy:
28+
29+
$ git clone https://github.com/<your_user>/challenges
30+
31+
## II. You already cloned your fork
32+
33+
* In this case you need to [sync our new challenge(s)](https://help.github.com/articles/syncing-a-fork/), in your fork directory:
34+
35+
# assuming using ssh key
36+
$ git remote add upstream [email protected]:pybites/challenges.git
37+
$ git fetch upstream
38+
39+
# if not on master:
40+
$ git checkout master
41+
$ git merge upstream/master
42+
# at this point you are asked to commit the merge
43+
44+
* Have fun :)
45+
46+
$ cd <challenge-number>
47+
# create new file or if template file provided: edit <template>.py
48+
49+
## III. Submit your code to our community branch via a Pull Request (PR)
50+
51+
This is still a bit of an experimental feature. We will update it as we go. If there is an easier way please let us know ...
52+
53+
* Work on community branch and get into sync. In your forked repo:
54+
55+
$ git checkout community (might need -b the first time)
56+
57+
* Make sure you got the latest changes from PyBites:
58+
59+
$ git pull upstream community
60+
61+
* From your local community branch Open a new branch, we use PCC<challenge_num> here as convention (PyBites Code Challenge)
62+
63+
$ git checkout -b PCC14
64+
65+
* Add your code
66+
67+
$ cd <challenge_number>
68+
$ mkdir <GH-username>
69+
$ add files ...
70+
71+
e.g.
72+
$ cd 14
73+
$ mkdir bbelderbos && cd $_
74+
$ vi some_script.py
75+
...
76+
77+
* Commit your changes:
78+
79+
$ git add .
80+
$ git commit -m "PCC14 bbelderbos"
81+
82+
* Push this local branch to your forked repo (origin is default remote after fork + clone):
83+
84+
$ git push origin PCC14
85+
86+
* Go to your cloned repo and open a PR by comparing pybites community branch with your newly pushed local branch (make sure only the files of your changes are included):
87+
88+
* Your push should create this link on your fork's main page:
89+
90+
![step 1](PR1.png)
91+
92+
* When you click it make sure you compare base fork: pybites/challenges - base: community with head fork: <username>/challenges - compare: <your-branch>:
93+
94+
![step 2](PR2.png)
95+
96+
* Make sure you only PR on the files you change, in this example I had 2 files in my new 'bbelderbos' dir:
97+
98+
![step 3](PR3.png)
99+
100+
The difficult part here was isolating the changes. We think that if you do the "git pull upstream community" into your local community branch, as described above, you should see only your changes, but we have to do some more testing. Please let us know how this goes ...
101+
102+
Finally we will check your code, merge it into our community branch, and feature it in our end-of-the-week review post.
103+
104+
## IV. Optional - Detaching the fork
105+
106+
* One small issue with working with a forked repo is that Github wont actually recognize any of your activity. If you want to see your activity follow these steps. However be warned that it will prevent you from creating pull-requests.
107+
108+
1. On Github go to the settings page of your forked repo.
109+
2. In the Danger Zone click on the Delete this repository button.
110+
3. Type the full name of the repo in the box and click the button.
111+
4. Create a new repo with the same name as the original repo.
112+
5. Push the repo to Github
113+
114+
$ git push origin master
115+
116+
---
117+
118+
## Feedback
119+
120+
* If you want to share your solution, please use the comments of [our review posts](http://pybit.es/pages/challenges.html).
121+
122+
* If you have ideas for new challenges or issues with existing ones, please use the [issues page](https://github.com/pybites/challenges/issues).
123+
124+
---
125+
126+
Remember: there is no best solution, only learning more/ better Python. We're looking forward reviewing our and your solutions.
127+
Good luck and have fun!
128+
129+
Keep Calm and Code in Python!
130+
131+
-- Bob and Julian

0 commit comments

Comments
 (0)