]> code.delx.au - gnu-emacs/blob - admin/notes/git-workflow
Use cherry-pick -xe instead of git log amend
[gnu-emacs] / admin / notes / git-workflow
1 (This is a draft. The method here won't actually work yet, because
2 neither git-new-workdir nor merge-changelog are in the Emacs
3 distribution yet.)
4
5 Setting up and using git for normal, simple bugfixing
6 =====================================================
7
8 If you haven't configured git before you should first do:
9
10 git config --global user.name "Frank Chu"
11 git config --global user.email "fchu@example.com"
12
13 Initial setup
14 =============
15
16 Then we want to clone the repository. We normally want to have both
17 the current trunk and the emacs-24 branch.
18
19 mkdir ~/emacs
20 cd ~/emacs
21 git clone <membername>@git.sv.gnu.org:/srv/git/emacs.git
22 mv emacs trunk
23 ./trunk/admin/git-new-workdir trunk emacs-24
24 cd emacs-24
25 git checkout emacs-24
26
27 You now have both branches conveniently accessible, and you can do
28 "git pull" in them once in a while to keep updated.
29
30
31 Fixing bugs
32 ===========
33
34 You edit the files in either branch, `M-x vc-dir', and check in your
35 changes. Then you need to push the data to the main repository. This
36 will usually fail, since somebody else has pushed other changes in the
37 meantime. To fix this, say
38
39 git pull --rebase
40
41 which will update your repository, and then re-apply your changes on
42 top of that. Then say
43
44 git push
45
46
47 Backporting to emacs-24
48 =======================
49
50 If you have applied a fix to the trunk, but then decide that it should
51 be applied to the emacs-24 branch, too, then
52
53 cd ~/emacs/trunk
54 git log
55
56 and find the commit you're looking for. Then find the commit ID,
57 which will look like
58
59 commit 958b768a6534ae6e77a8547a56fc31b46b63710b
60
61 cd ~/emacs/emacs-24
62 git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b
63
64 and add "Backport:" to the commit string. Then
65
66 git push
67
68
69 Merging emacs-24 to trunk
70 =========================
71
72 This has yet to be written.