@@ -102,117 +102,119 @@ Recurse through the Tree
102
102
Usage
103
103
****************
104
104
105
- * $ git add <filepath>
106
-
107
- .. literalinclude :: ../../test/test_quick_doc.py
108
- :language: python
109
- :dedent: 8
110
- :start-after: # [2-test_cloned_repo_object]
111
- :end-before: # ![2-test_cloned_repo_object]
112
-
113
- Now lets add the updated file to git
114
-
115
- .. literalinclude :: ../../test/test_quick_doc.py
116
- :language: python
117
- :dedent: 8
118
- :start-after: # [3-test_cloned_repo_object]
119
- :end-before: # ![3-test_cloned_repo_object]
120
-
121
- Notice the add method requires a list as a parameter
122
-
123
- Warning: If you experience any trouble with this, try to invoke :class: `git <git.cmd.Git> ` instead via repo.git.add(path)
124
-
125
- * $ git commit -m message
126
-
127
- .. literalinclude :: ../../test/test_quick_doc.py
128
- :language: python
129
- :dedent: 8
130
- :start-after: # [4-test_cloned_repo_object]
131
- :end-before: # ![4-test_cloned_repo_object]
132
-
133
- * $ git log <file>
134
-
135
- A list of commits associated with a file
136
-
137
- .. literalinclude :: ../../test/test_quick_doc.py
138
- :language: python
139
- :dedent: 8
140
- :start-after: # [5-test_cloned_repo_object]
141
- :end-before: # ![5-test_cloned_repo_object]
142
-
143
- Notice this returns a generator object
144
-
145
- .. literalinclude :: ../../test/test_quick_doc.py
146
- :language: python
147
- :dedent: 8
148
- :start-after: # [6-test_cloned_repo_object]
149
- :end-before: # ![6-test_cloned_repo_object]
150
-
151
- returns list of :class: `Commit <git.objects.commit.Commit> ` objects
152
-
153
- Printing text files
154
- ####################
155
- Lets print the latest version of `<local_dir> dir1/file2.txt `
105
+ Add file to staging area
106
+ ########################
156
107
157
- .. literalinclude :: ../../test/test_quick_doc.py
158
- :language: python
159
- :dedent: 8
160
- :start-after: # [17-test_cloned_repo_object]
161
- :end-before: # ![17-test_cloned_repo_object]
162
108
163
- .. literalinclude :: ../../test/test_quick_doc.py
109
+ .. literalinclude :: ../../test/test_quick_doc.py
164
110
:language: python
165
111
:dedent: 8
166
- :start-after: # [18 -test_cloned_repo_object]
167
- :end-before: # ![18 -test_cloned_repo_object]
112
+ :start-after: # [2 -test_cloned_repo_object]
113
+ :end-before: # ![2 -test_cloned_repo_object]
168
114
169
- Previous version of ` <local_dir>/dir1/file2.txt `
115
+ Now lets add the updated file to git
170
116
171
- .. literalinclude :: ../../test/test_quick_doc.py
117
+ .. literalinclude :: ../../test/test_quick_doc.py
172
118
:language: python
173
119
:dedent: 8
174
- :start-after: # [18.1 -test_cloned_repo_object]
175
- :end-before: # ![18.1 -test_cloned_repo_object]
120
+ :start-after: # [3 -test_cloned_repo_object]
121
+ :end-before: # ![3 -test_cloned_repo_object]
176
122
177
- * $ git status
123
+ Notice the add method requires a list as a parameter
178
124
179
- * Untracked files
125
+ Warning: If you experience any trouble with this, try to invoke :class: ` git <git.cmd.Git> ` instead via repo.git.add(path)
180
126
181
- Lets create a new file
127
+ Commit
128
+ ######
182
129
183
130
.. literalinclude :: ../../test/test_quick_doc.py
184
131
:language: python
185
132
:dedent: 8
186
- :start-after: # [7-test_cloned_repo_object]
187
- :end-before: # ![7-test_cloned_repo_object]
133
+ :start-after: # [4-test_cloned_repo_object]
134
+ :end-before: # ![4-test_cloned_repo_object]
135
+
136
+ List of commits associated with a file
137
+ #######################################
188
138
189
139
.. literalinclude :: ../../test/test_quick_doc.py
190
140
:language: python
191
141
:dedent: 8
192
- :start-after: # [8 -test_cloned_repo_object]
193
- :end-before: # ![8 -test_cloned_repo_object]
142
+ :start-after: # [5 -test_cloned_repo_object]
143
+ :end-before: # ![5 -test_cloned_repo_object]
194
144
195
- * Modified files
145
+ Notice this returns a generator object
196
146
197
147
.. literalinclude :: ../../test/test_quick_doc.py
198
148
:language: python
199
149
:dedent: 8
200
- :start-after: # [9-test_cloned_repo_object]
201
- :end-before: # ![9-test_cloned_repo_object]
150
+ :start-after: # [6-test_cloned_repo_object]
151
+ :end-before: # ![6-test_cloned_repo_object]
152
+
153
+ returns list of :class: `Commit <git.objects.commit.Commit> ` objects
154
+
155
+ Printing text files
156
+ ####################
157
+ Lets print the latest version of `<local_dir> dir1/file2.txt `
202
158
203
159
.. literalinclude :: ../../test/test_quick_doc.py
204
- :language: python
205
- :dedent: 8
206
- :start-after: # [10-test_cloned_repo_object]
207
- :end-before: # ![10-test_cloned_repo_object]
160
+ :language: python
161
+ :dedent: 8
162
+ :start-after: # [17-test_cloned_repo_object]
163
+ :end-before: # ![17-test_cloned_repo_object]
164
+
165
+ .. literalinclude :: ../../test/test_quick_doc.py
166
+ :language: python
167
+ :dedent: 8
168
+ :start-after: # [18-test_cloned_repo_object]
169
+ :end-before: # ![18-test_cloned_repo_object]
208
170
209
- returns a list of :class: ` Diff <git.diff.Diff> ` objects
171
+ Previous version of ` <local_dir>/dir1/file2.txt `
210
172
211
173
.. literalinclude :: ../../test/test_quick_doc.py
212
- :language: python
213
- :dedent: 8
214
- :start-after: # [11-test_cloned_repo_object]
215
- :end-before: # ![11-test_cloned_repo_object]
174
+ :language: python
175
+ :dedent: 8
176
+ :start-after: # [18.1-test_cloned_repo_object]
177
+ :end-before: # ![18.1-test_cloned_repo_object]
178
+
179
+ Status
180
+ ######
181
+ * Untracked files
182
+
183
+ Lets create a new file
184
+
185
+ .. literalinclude :: ../../test/test_quick_doc.py
186
+ :language: python
187
+ :dedent: 8
188
+ :start-after: # [7-test_cloned_repo_object]
189
+ :end-before: # ![7-test_cloned_repo_object]
190
+
191
+ .. literalinclude :: ../../test/test_quick_doc.py
192
+ :language: python
193
+ :dedent: 8
194
+ :start-after: # [8-test_cloned_repo_object]
195
+ :end-before: # ![8-test_cloned_repo_object]
196
+
197
+ * Modified files
198
+
199
+ .. literalinclude :: ../../test/test_quick_doc.py
200
+ :language: python
201
+ :dedent: 8
202
+ :start-after: # [9-test_cloned_repo_object]
203
+ :end-before: # ![9-test_cloned_repo_object]
204
+
205
+ .. literalinclude :: ../../test/test_quick_doc.py
206
+ :language: python
207
+ :dedent: 8
208
+ :start-after: # [10-test_cloned_repo_object]
209
+ :end-before: # ![10-test_cloned_repo_object]
210
+
211
+ returns a list of :class: `Diff <git.diff.Diff> ` objects
212
+
213
+ .. literalinclude :: ../../test/test_quick_doc.py
214
+ :language: python
215
+ :dedent: 8
216
+ :start-after: # [11-test_cloned_repo_object]
217
+ :end-before: # ![11-test_cloned_repo_object]
216
218
217
219
218
220
0 commit comments