suggest a better interim workflow in got.1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
diff --git a/got/got.1 b/got/got.1
index 97673ca..21a94c1 100644
--- a/got/got.1
+++ b/got/got.1
@@ -388,38 +388,29 @@ The editor spawned by
.Sh EXIT STATUS
.Ex -std got
.Sh EXAMPLES
-Check out a work tree of
-.Ox
-kernel sources from a Git repository at /var/git/openbsd-src to ~/sys:
.Pp
-.Dl $ got checkout -p sys /var/git/openbsd-src ~/sys
+Clone an existing Git repository for use with
+.Nm .
+This step currently requires
+.Xr git 1 :
.Pp
-View local changes in a work tree directory:
-.Pp
-.Dl $ got status
-.Dl $ got diff | less
+.Dl $ cd /var/git/
+.Dl $ git clone --bare https://github.com/openbsd/src.git
.Pp
-Create a new commit from local changes in a work tree directory.
-This new commit will become the head commit of the work tree's current branch:
+Check out a work tree from this Git repository to /usr/src:
.Pp
-.Dl $ got commit
+.Dl $ got checkout /var/git/src.git /usr/src
.Pp
-In a work tree or a git repository directory, view changes committed in
-the 3 most recent commits to the repository:
+View local changes in a work tree directory:
.Pp
-.Dl $ got log -p -l 3
+.Dl $ got status
+.Dl $ got diff | less
.Pp
In a work tree or a git repository directory, list all branch references:
.Pp
.Dl $ got ref -l | grep ^refs/heads
.Pp
-In a work tree or a git repository directory, view changes committed in
-the 3 most recent commits to the work tree's branch, or the branch resolved
-via the repository's HEAD reference, respectively:
-.Pp
-.Dl $ got log -p -l 3 -b
-.Pp
-In a work tree or a git repository directory, create a new branch
+In a work tree or a git repository directory, create a new branch called
.Dq unified-buffer-cache
which is forked off the
.Dq master
@@ -433,10 +424,21 @@ Local changes in the work tree will be preserved and merged if necessary:
.Pp
.Dl $ got update -b unified-buffer-cache
.Pp
+Create a new commit from local changes in a work tree directory.
+This new commit will become the head commit of the work tree's current branch:
+.Pp
+.Dl $ got commit
+.Pp
+In a work tree or a git repository directory, view changes committed in
+the 3 most recent commits to the work tree's branch, or the branch resolved
+via the repository's HEAD reference, respectively:
+.Pp
+.Dl $ got log -p -l 3 -b
+.Pp
Add new files and remove obsolete files in a work tree directory:
.Pp
-.Dl $ got add uvm/uvm_ubc.c
-.Dl $ got rm uvm/uvm_vnode.*
+.Dl $ got add sys/uvm/uvm_ubc.c
+.Dl $ got rm sys/uvm/uvm_vnode.c
.Pp
Create a new commit from local changes in a work tree directory
with a pre-defined log message.
@@ -449,6 +451,42 @@ branch to the latest commit on this branch:
.Pp
.Dl $ got update
.Pp
+Fetch new upstream commits into the local repository's master branch:
+.Pp
+.Dl $ cd /var/git/src.git
+.Dl $ git fetch origin master:master
+.Pp
+Rebase the
+.Dq unified-buffer-cache
+branch on top of the new head commit of the
+.Dq master
+branch.
+This step currently requires
+.Xr git 1 :
+.Pp
+.Dl $ git clone /var/git/src.git ~/src-git-wt
+.Dl $ cd ~/src-git-wt
+.Dl $ git checkout unified-buffer-cache
+.Dl $ git rebase master
+.Dl $ git push -f
+.Pp
+Create a new branch reference for a work tree which has lost
+linear ancestry with its recorded branch reference and thus
+can no longer be updated:
+.Pp
+.Dl $ got ref refs/heads/old-branch $(cat .got/base-commit)
+.Dl $ got update
+.Pp
+Update the work tree to the newly rebased
+.Dq unified-buffer-cache
+branch:
+.Pp
+.Dl $ got update -b unified-buffer-cache
+.Pp
+Delete a reference which is no longer needed:
+.Pp
+.Dl $ got ref -d refs/heads/old-branch
+.Pp
.Sh SEE ALSO
.Xr git-repository 5
.Xr got-worktree 5
@@ -456,3 +494,17 @@ branch to the latest commit on this branch:
.An Stefan Sperling Aq Mt stsp@openbsd.org
.An Martin Pieuchot Aq Mt mpi@openbsd.org
.An joshua stein Aq Mt jcs@openbsd.org
+.Sh CAVEATS
+.Nm
+is a work-in-progress and many commands remain to be implemented.
+At present, the user has to fall back on
+.Xr git 1
+to perform many basic tasks.
+.Pp
+When working against a repository created with
+.Dq git clone --bare ,
+local commits to the
+.Dq master
+branch are discouraged, for now, if changes committed to the upstream
+repository need to be tracked.
+See the EXAMPLES section.