From c7a2a25fe4479b1f410e258a5a98a0be88a7cc3f Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 30 Sep 2014 10:05:27 -0400
Subject: [PATCH] Fix cropped ticket status indicator

---
 src/site/tickets_using.mkd |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/site/tickets_using.mkd b/src/site/tickets_using.mkd
index 3936e00..5712845 100644
--- a/src/site/tickets_using.mkd
+++ b/src/site/tickets_using.mkd
@@ -28,7 +28,7 @@
     ...add a single commit...
     git push origin HEAD:refs/for/new
     # read ticket id from server output
-    git branch --set-upstream-to=origin/ticket/{id}
+    git branch -u origin/ticket/{id}
 
 ### Creating the first Patchset for an Existing Ticket
 
@@ -42,7 +42,7 @@
     cd repo
     git checkout -b ticket/{id}
     ...add one or more commits...
-    git push --set-upstream origin ticket/{id}
+    git push -u origin ticket/{id}
 
 ### Safely adding commits to a Patchset for an Existing Ticket
 
@@ -58,6 +58,14 @@
     git pull --ff-only
     ...add one or more commits...
     git push
+
+### Checking-Out a Named Branch for an Existing Ticket with a Patchset
+
+If you prefer to name your local ticket branches rather than using the default integer ids, you can do this with a little more syntax.
+
+    git checkout -b my_fix --track origin/ticket/{id}
+
+This will create a local branch named *my_fix* which tracks the upstream ticket branch.
 
 ### Rewriting a Patchset (amend, rebase, squash)
 
@@ -76,21 +84,18 @@
 
 ### Updating your copy of a rewritten Patchset
 
-If a patchset has been rewritten you can no longer simply *pull* to update.  Let's assume your checkout **does not** have any unshared commits - i.e. it represents the previous patchset.  The simplest way to update your branch to the current patchset is to reset it.
+If a patchset has been rewritten you can no longer simply *pull* to update.  Let's assume your checkout **does not** have any unshared commits - i.e. it represents the previous patchset.  The simplest way to update your branch to the current patchset is to reset it using the `-B` checkout flag.
 
-    git fetch && git checkout ticket/{id}
-    git reset --hard origin/ticket/{id}
+    git fetch && git checkout -B ticket/{id}
 
 If you **do** have unshared commits then you'll could make a new temporary branch and then cherry-pick your changes onto the rewritten patchset.
 
     git branch oldticket ticket/{id}
-    git fetch && git checkout ticket/{id}
-    git reset --hard origin/ticket/{id}
+    git fetch && git checkout -B ticket/{id}
     git cherry-pick <commitid1> <commitid2>
     git branch -D oldticket
 
 Git is a very flexible tool, there are no doubt several other strategies you could use to resolve this situation.  The above solution is just one way.
-
 
 ### Ticket RefSpecs
 

--
Gitblit v1.9.1