X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/760a7cfc29f0645056b04e4d6f7c63cb46b4d384..a0045b8750ffa368be49de692dc309d0a7459eb2:/Documentation/tutorial.txt?ds=sidebyside diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt index 8e0adbf..8af50ef 100644 --- a/Documentation/tutorial.txt +++ b/Documentation/tutorial.txt @@ -2,7 +2,7 @@ StGit tutorial ############## StGit is a command-line application that provides functionality -similar to htmllink:http://savannah.nongnu.org/projects/quilt/[Quilt] +similar to link:http://savannah.nongnu.org/projects/quilt/[Quilt] (i.e. pushing/popping patches to/from a stack), but using Git instead of +diff+ and +patch+. StGit stores its patches in a Git repository as normal Git commits, and provides a number of commands to manipulate @@ -10,7 +10,7 @@ them in various ways. This tutorial assumes you are already familiar with the basics of Git (for example, branches, commits, and conflicts). For more information -on Git, see manlink:git[1] or htmllink:http://git.or.cz/[the Git home +on Git, see linkman:git[1] or link:http://git.or.cz/[the Git home page]. @@ -29,7 +29,7 @@ For more extensive help on a subcommand: $ man stg- -(The documentation is also available in htmllink:stg.html[HTML +(The documentation is also available in link:stg.html[HTML format].) @@ -40,7 +40,7 @@ StGit is not a stand-alone program -- it operates on a Git repository that you have already created, using +git init+ or +git clone+. So get one of those; if you don't have one at hand, try for example - $ git clone http://homepage.ntlworld.com/cmarinas/stgit.git + $ git clone git://repo.or.cz/stgit.git $ cd stgit Before you can create StGit patches, you have to run linkstg:init[]: @@ -104,13 +104,13 @@ And voilà -- the patch is no longer empty: finally: (I'm assuming you're already familiar with -htmllink:http://en.wikipedia.org/wiki/Diff#Unified_format[unified +link:http://en.wikipedia.org/wiki/Diff#Unified_format[unified diff] patches like this from Git, but it's really quite simple; in this example, I've added the +$$print 'My first patch!'$$+ line to the file +stgit/main.py+, at around line 171.) Since the patch is also a regular Git commit, you can also look at it -with regular Git tools such as manlink:gitk[]. +with regular Git tools such as linkman:gitk[]. Creating another patch ---------------------- @@ -156,7 +156,7 @@ make. The minus sign says that +credit+ is 'unapplied' -- this means that it's been temporarily put aside. If you look at the +AUTHORS+ file, you'll see that our change to it is gone; and tools such as -manlink:gitk[] will not show it, because it's been edited out of the +linkman:gitk[] will not show it, because it's been edited out of the Git history. But it's just one linkstg:push[] command away from being restored: @@ -258,9 +258,6 @@ top of +second+, now that they both modify +TODO+. We can take a look at the situation with linkstg:status[]: $ stg status - ? TODO.ancestor - ? TODO.current - ? TODO.patched C TODO As we were told by linkstg:push[], the conflict is in the file +TODO+. @@ -268,19 +265,14 @@ As we were told by linkstg:push[], the conflict is in the file +TODO+. listed here; prefixed with +C+ if they had conflicts, and +M+ if StGit managed to automatically resolve everything in the file.) -NOTE: +TODO.ancestor+, +TODO.current+, and +TODO.patched+ are the -three versions of the file that StGit tried to merge. The +.current+ -file is the version before the patch was applied, +.patched+ is the -version in the patch we tried to push, and +.ancestor+ the version -that contains neither of the added lines. - At this point, we have two options: 1. Undo the failed merge with linkstg:undo[]. (Remember to use the +$$--hard$$+ flag, since the unresolved conflict means the worktree is not clean.) - 2. Manually resolve the conflict. + 2. Manually resolve the conflict (editing the file directly followed + by +git add+ or using +git mergetool+.) To resolve the conflict, open +TODO+ in your favorite editor. It ends like this: @@ -313,7 +305,7 @@ markers. Now that we've resolved the conflict, we just need to tell StGit about it: - $ stg resolved TODO + $ git add TODO $ stg status M TODO