-
Notifications
You must be signed in to change notification settings - Fork 10
Managing Branches in GitHub
NOTE: This page is an early draft. Pay it no attention until this notice is removed.
Following the release of perfSONAR 4.1, the development team adopted a more-formal scheme for version control during development. There are central tenets:
- Any change is to be developed along a branch named after the release for which it is intended.
- Once the code on the branch is ready to be released, the branch is closed and the release is done.
- Changes made in the branch are merged into branches for later releases.
After a repository has been cloned, the standard perfSONAR Git hooks can be used to do client-side enforcement of branch closures. Installing the hooks is optional but strongly recommended.
-
Select the release for which the change is targeted. This will depend on the nature of the change. For example, a new major feature not present in version
9.0
would be targeted for9.1
. -
Open an issue to cover the change and set the release to correspond with the one selected above. Note the number of the new issue.
9999
will be used as an example. -
Check out the
9.1
branch. -
Create a new branch from
9.1
calledissue-9999
. -
Check out the
issue-9999
branch. -
Develop, commit and push changes.
-
Submit a pull request to merge
issue-9999
into9.1
. Once the change is pulled, theissue-9999
branch will be deleted.
Once a branch is considered ready for release, it is closed to further changes. Enforcement of this closure happens at two levels: in the local repository using a hook within the Git repository (which can be bypassed) and administratively within GitHub (which cannot).
(Note that this process will, at some point, be automated.)
- Make sure the repository has been prepared as described above.
- Change into the root directory of the repository.
touch BRANCH-CLOSED
git add BRANCH-CLOSED
git commit -a -m "Closing branch for release."
git push
- Log into GitHub using an administrator account.
- Go to the repository that is to be closed.
- Select the
Settings
tab. - Select
Branches
in the left-side pane. - Click
Add Rule
. - Apply the rule to the name of the branch being closed (e.g.,
9.1
). Note that wildcards are possible, so the number of rules can be kept down by using them. (E.g., if all of the 9.x releases are closed, a single9*
rule would cover all of them.) - Select
Include administrators
. - Select
Restrict who can push to matching branches
. Put only the release administrator,arlake228
on the list. - Click
Add
. Note that the change may take a few minutes to take effect.
TODO: Flesh this out.
-
9.0
(Paradigm Shift release)- Close the
9.0
branch (see above) - Create
9.0.0.1
(Fast-Track Patch) - Create
9.0.1
(Bug Fix / Minor Enhancement) - Create
9.1
(Major Feature) - Create
10
(Paradigm Shift) - Pull
9.0
intomaster
and tag itrelease-9.0
- Close the
-
9.0.0.1 (Fast-Track Patch)
- Lock the
9.0.0.1
branch (see above) - Create 9.0.0.2 (Fast-Track Patch)
- Pull
9.0.0.1
intomaster
and tag itrelease-9.0.0.1
- Lock the
-
9.0.1 (Bug Fix / Minor Enhancement)
- Create 9.0.1.1 (Fast-Track Patch)
- Pull
9.0.1
intomaster
and tag itrelease-9.0.1