1
.. _maintainer-workflow:
7
This page is for maintainers |emdash| those of us who merge our own or other
8
peoples' changes into the upstream repository.
10
Being as how you're a maintainer, you are completely on top of the basic stuff
11
in :ref:`development-workflow`.
13
The instructions in :ref:`linking-to-upstream` add a remote that has read-only
14
access to the upstream repo. Being a maintainer, you've got read-write access.
16
It's good to have your upstream remote have a scary name, to remind you that
17
it's a read-write remote::
19
git remote add upstream-rw git@github.com:nipy/nibabel.git
26
Let's say you have some changes that need to go into trunk
27
(``upstream-rw/master``).
29
The changes are in some branch that you are currently on. For example, you are
30
looking at someone's changes like this::
32
git remote add someone git://github.com/someone/nibabel.git
34
git branch cool-feature --track someone/cool-feature
35
git checkout cool-feature
37
So now you are on the branch with the changes to be incorporated upstream. The
38
rest of this section assumes you are on this branch.
43
If there are only a few commits, consider rebasing to upstream::
45
# Fetch upstream changes
48
git rebase upstream-rw/master
50
Remember that, if you do a rebase, and push that, you'll have to close any
51
github pull requests manually, because github will not be able to detect the
52
changes have already been merged.
54
A long series of commits
55
========================
57
If there are a longer series of related commits, consider a merge instead::
60
git merge --no-ff upstream-rw/master
62
The merge will be detected by github, and should close any related pull requests
65
Note the ``--no-ff`` above. This forces git to make a merge commit, rather than
66
doing a fast-forward, so that these set of commits branch off trunk then rejoin
67
the main history with a merge, rather than appearing to have been made directly
73
Now, in either case, you should check that the history is sensible and you have
76
git log --oneline --graph
77
git log -p upstream-rw/master..
79
The first line above just shows the history in a compact way, with a text
80
representation of the history graph. The second line shows the log of commits
81
excluding those that can be reached from trunk (``upstream-rw/master``), and
82
including those that can be reached from current HEAD (implied with the ``..``
83
at the end). So, it shows the commits unique to this branch compared to trunk.
84
The ``-p`` option shows the diff for these commits in patch form.
91
git push upstream-rw my-new-feature:master
93
This pushes the ``my-new-feature`` branch in this repository to the ``master``
94
branch in the ``upstream-rw`` repository.
96
.. include:: links.inc