@@ -58,36 +58,40 @@ You'll need to fork the `python-docs-fr
58
58
button. This creates a copy of the whole project on your github
59
59
account: a place where you have the rights to do modifications.
60
60
61
- Step by steps::
61
+ Step by steps:
62
+
63
+ .. code-block :: bash
62
64
63
65
# Git clone your github fork using ssh (replace JulienPalard):
64
- $ git clone git@github.com:JulienPalard/python-docs-fr.git
66
+ git clone git@github.com:JulienPalard/python-docs-fr.git
65
67
66
68
# Go to the cloned directory:
67
- $ cd python-docs-fr/
69
+ cd python-docs-fr/
68
70
69
71
# Add the upstream (the public repository) using HTTPS (won't ask for password):
70
- $ git remote add upstream https://github.com/python/python-docs-fr.git
72
+ git remote add upstream https://github.com/python/python-docs-fr.git
71
73
72
74
73
- Now you're ready to start a work session, each time you'll start a new task, start here::
75
+ Now you're ready to start a work session, each time you'll start a new task, start here:
76
+
77
+ .. code-block :: bash
74
78
75
79
# To work, we'll need a branch, based on an up-to-date (freshly fetched)
76
80
# upstream/3.7 branch, let's say we'll work on glossary so we name
77
81
# the branch "glossary":
78
- $ git fetch upstream
79
- $ git checkout -b glossary upstream/3.7
82
+ git fetch upstream
83
+ git checkout -b glossary upstream/3.7
80
84
81
85
# You can now work on the file, typically using poedit,
82
86
# then commit your work with a nice explicit message:
83
- $ git commit -a -m "Working on glossary."
87
+ git commit -a -m " Working on glossary."
84
88
85
89
# Then push your modifications to your github clone,
86
90
# as they are ephemeral branches, let's not configure git to track them all,
87
91
# "origin HEAD" is a "special" syntax to say "Push on origin,
88
92
# on a branch with the same name as the local one",
89
93
# it's nice as it's exactly what we want:
90
- $ git push origin HEAD
94
+ git push origin HEAD
91
95
92
96
# Now you can open the pull request on github, just go to
93
97
# https://github.com/python/python-docs-fr/ and a nice "Compare & pull request"
@@ -96,10 +100,10 @@ Now you're ready to start a work session, each time you'll start a new task, sta
96
100
# Now someone is reviewing your modifications, and you'll want to fix their
97
101
# findings, get back to your branch
98
102
# (in case you started something else on another branch):
99
- $ git checkout glossary
103
+ git checkout glossary
100
104
# Fix the issues, then commit again:
101
- $ git commit -a -m "glossary: small fixes."
102
- $ git push origin HEAD
105
+ git commit -a -m " glossary: small fixes."
106
+ git push origin HEAD
103
107
104
108
105
109
You may have noted that this looks like a triangle, with a missing segment:
@@ -227,12 +231,16 @@ Simplify git diffs
227
231
228
232
Git diffs are often crowded with useless line number changes, like:
229
233
234
+ .. code-block :: diff
235
+
230
236
-#: ../Doc/library/signal.rst:406
231
237
+#: ../Doc/library/signal.rst:408
232
238
233
239
To tell git they are not usefull information, you can do the following
234
240
after ensuring ``~/.local/bin/ `` is in your ``PATH ``.
235
241
242
+ .. code-block :: bash
243
+
236
244
cat << EOF > ~/.local/bin/podiff
237
245
#!/bin/sh
238
246
grep -v '^#:' "\$ 1"
@@ -254,7 +262,9 @@ like::
254
262
├── python-docs-fr/
255
263
└── cpython/
256
264
257
- To clone CPython you may use::
265
+ To clone CPython you may use:
266
+
267
+ .. code-block:: bash
258
268
259
269
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git
260
270
0 commit comments