diff options
| author | Lars Magne Ingebrigtsen | 2014-11-15 17:06:34 +0100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2014-11-15 17:06:34 +0100 |
| commit | 788bc73c80bcd1e748a389692963c1464ba963df (patch) | |
| tree | 7debb5bf55a3536ccf05ac51059b7e21f405ed27 /admin/notes/git-workflow | |
| parent | 658b768a6534ae6e77a8547a56fc31b46b63710b (diff) | |
| download | emacs-788bc73c80bcd1e748a389692963c1464ba963df.tar.gz emacs-788bc73c80bcd1e748a389692963c1464ba963df.zip | |
Add a draft of a very simple git workflow
Diffstat (limited to 'admin/notes/git-workflow')
| -rw-r--r-- | admin/notes/git-workflow | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow new file mode 100644 index 00000000000..4bda3f5c909 --- /dev/null +++ b/admin/notes/git-workflow | |||
| @@ -0,0 +1,73 @@ | |||
| 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 958b768a6534ae6e77a8547a56fc31b46b63710b | ||
| 63 | git commit --amend | ||
| 64 | |||
| 65 | and add "Backport:" to the commit string. Then | ||
| 66 | |||
| 67 | git push | ||
| 68 | |||
| 69 | |||
| 70 | Merging emacs-24 to trunk | ||
| 71 | ========================= | ||
| 72 | |||
| 73 | This has yet to be written. | ||