Creating a Release from a Feature Branch
Assumptions
- All changes to be included in the release have been made on the
    
feature-branch - We release from the 
masterbranch by mergingfeature-branchinto themasterbranch - A feature release (e.g. X.Y.0) gets a branch of its own off of
    the 
master 
Steps
- 
Commit all your changes on the
feature-branch - 
Merge the
masterbranch into thefeature-branchand get all conflicts resolved.This is in case any changes were made in the
masterbranch since the point at which thefeature-branchwas branched off from themaster$ git checkout feature-branch $ git merge master - 
Merge the
feature-branchinto themasterbranch and squash the changes into one big change set.This is to get the
feature-branchchanges into themasterfor use in the release and to ensure that these changes are included in any subsequent feature change branches. (Since feature change branches should be branches off of themaster.) The squashing means that all the changes for the current feature will be under one commit comment.$ git checkout master $ git merge --squash feature-branch - 
Fix up the
version.txtfile -- make it saymaster$ git_current_branch > version.txt $ get add version.txtNote:
git_current_branchshould be an alias defined as:alias git_current_branch='git symbolic-ref -q HEAD --short' - 
Commit all changes to the
masterbranch. This is the one commit for all of the feature-related changes$ git commit -m "Big description of feature branch changes"Now all the changes you made in
feature-branchare in themasterbranch. - 
Push everything to the origin (GitHub)
$ git push origin --all - 
Remove the local
feature-branchwhose changes you\'ve now merged and committed to themasterbranch.$ git branch -D feature-branch - 
Remove the remote
feature-branchfrom the origin repository (GitHub)$ git push origin --delete feature-branch - 
Create a release version in a release branch
$ git checkout master $ git branch release/v1.7.0 # substitute your intended release number $ git checkout release/v1.7.0 $ git_current_branch > version.txt $ git add version.txt $ git commit -m "Created v1.7.0" $ git tag -a v1.7.0 -m "Tagging v1.7.0" $ git push --tags origin release/v1.7.0 - 
Go to https://github.com, log in, and create a release from the tag
Releases --> Draft a new release --> Select tag
- Provide a Title: e.g. \"Multirun ICA+fIX on 7T Retinotopy Data\"
 - Provide a Description: e.g. \"This release is intended to be used for running Multirun ICA+FIX processing on 7T Retinotopy data\"
 - Publish the release
 
 - 
Make sure you don\'t leave your local
gitrepository with the release branch checked out.You do not want to make further changes to that branch. If you are making a bugfix release (a final point release, e.g. v1.7.1 or v1.7.2), you will create a feature/bugfix branch off of the release branch.
$ git checkout master - 
Make sure all the changes in the release branch are merged into the
masterbranch and themasterbranch is ready to use as a starting point for future changes.bash $ git merge release/v1.7.0 # substitute your release number $ git_current_branch > version.txt $ git add version.txt $ git commit -m "Updated version.txt" $ git push origin --all - 
Further changes should be done in a new feature branch, not on the
masterbranch.