summaryrefslogtreecommitdiff
path: root/doc/source/tutorial.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source/tutorial.rst')
-rw-r--r--doc/source/tutorial.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst
index 5530cedd..a9a3f81d 100644
--- a/doc/source/tutorial.rst
+++ b/doc/source/tutorial.rst
@@ -385,6 +385,21 @@ The item returned is a DiffIndex which is essentially a list of Diff objects. It
for diff_added in wdiff.iter_change_type('A'): do_something_with(diff_added)
+Use the diff framework if you want to implement git-status like functionality.
+
+* A diff between the index and the commit's tree your HEAD points to
+
+ * use repo.index.diff(repo.head)
+
+* A diff between the index and the working tree
+
+ * use repo.index.diff(None)
+
+* A list of untracked files
+
+ * use repo.untracked_files
+
+
Switching Branches
******************
To switch between branches, you effectively need to point your HEAD to the new branch head and reset your index and working copy to match. A simple manual way to do it is the following one::