]> sipb.mit.edu Git - ikiwiki.git/blob - doc/rcs/gitmanual.mdwn
web commit by http://natalian.org/
[ikiwiki.git] / doc / rcs / gitmanual.mdwn
1 Main use case I am trying to accomplish: Edit wiki pages offline.
2
3 1. Imagine you're the administrator of the site and you want to checkout the wiki sources to give them some love while on a train journey.
4 2. Or you are writing a complex document and you want to simply use your favourite $EDITOR
5 3. Learn a little more about [git](http://git.or.cz/)
6
7 # Workflow
8
9 ## on webconverger.org/si.dabase.com/hendry
10
11 Wiki page created with [ikiwiki](http://ikiwiki.info). Example usb.mdwn [usb](http://webconverger.org/usb/)
12
13 ## on monty (my laptop)
14
15 I wonder why a "pull" doesn't just init a repo like a "svn co" does?
16
17 I think I should have used `git-clone ssh://si.dabase.com/home/hendry/wikiwc/.git/`
18
19     monty:~/git-testing% git-init
20     Initialized empty Git repository in .git/
21
22 You might want to set some config variables like your email as this [tutorial](http://www.kernel.org/pub/software/scm/git/docs/tutorial.html) describes.
23
24     monty:~/git-testing% git-pull ssh://si.dabase.com/home/hendry/wikiwc/.git/
25     warning: no common commits
26     remote: Generating pack...
27     remote: Done counting 746 objects.
28     remote: Deltifying 746 objects...
29     remote:  100% (746/746) done
30     Indexing 746 objects...
31     remote: Total 746 (delta 443), reused 723 (delta 431)
32      100% (746/746) done
33     Resolving 443 deltas...
34      100% (443/443) done
35
36     echo "blah" >> usb.mdwn
37     monty:~/git-testing% git-commit -a -m "added test"
38     Created commit d3507df: added test
39      1 files changed, 1 insertions(+), 0 deletions(-)
40
41     monty:~/git-testing% git-push ssh://si.dabase.com/home/hendry/wikiwc/.git/
42     updating 'refs/heads/master'
43       from 75a4a8e94e5fff2a4beced1574e772742d3f9847
44       to   d3507dfe19b469e61a728d1b0a833a5f480f5802
45     Generating pack...
46     Done counting 5 objects.
47     Result has 3 objects.
48     Deltifying 3 objects...
49      100% (3/3) done
50     Writing 3 objects...
51      100% (3/3) done
52     Total 3 (delta 2), reused 0 (delta 0)
53     refs/heads/master: 75a4a8e94e5fff2a4beced1574e772742d3f9847 -> d3507dfe19b469e61a728d1b0a833a5f480f5802
54
55
56 ## on webconverger.org/si.dabase.com/hendry
57
58     hendry:239$ git-status 
59     # On branch master
60     # Changes to be committed:
61     #   (use "git reset HEAD <file>..." to unstage)
62     #
63     #       modified:   usb.mdwn
64     #
65     # Untracked files:
66     #   (use "git add <file>..." to include in what will be committed)
67     #
68     #       .ikiwiki/
69
70 Great, we see the usb.mdwn file has been modified. Now we need to check it out to update the local work tree (and the wiki?)
71
72     hendry:242$ git-checkout master usb.mdwn
73
74
75 # Stuff I am confused about
76
77 * this master/origin stuff
78 * why do I have to explicitly say the filename "usb.mdwn" for it to be updated?
79 * why do I have to explicitly have to write the url if I am going a git-pull again? I know I can alias it, but why can't it just pull from the last source?
80 * how ikiwiki interfaces with git. does it have its own working copy? or is it the files simply in ~/wikiwc?
81 * I know git-push seems unpopular (git-pull seems to have the emphasis), though I think it is really convenient
82
83 # Ack
84
85 Thanks to gitte on #git on Freenode