Feature Branching from Centralised Workflow

Feature Branching from Centralised Workflow

Feature branching is the logical advance from centralised workflow (but one step below Git WorkFlow).

A specific feature should be developed in a dedicated branch instead of the master branch. With such a mechanisim, it becomes simple for mutliple developers to work together on different features without disturbubing the main codebase and also mains that the main branch should never contain broken code and only approved (hopefully via an automated test/authorisation pipeline) pull-requests make it back to the master branch.

 

read -p "Enter the (name and - optional) ticket number of the branch: " str_BranchName
str_BranchName=${str_BranchName// /_}

 

if git branch | grep ${str_BranchName} ; then
  echo "Warning Branch already exixts"
  echo "maybe fast forward changes from upstream"
  echo "maybe git checkout master / git fetch upstream / git pull upstream master / git push origin ${str_BranchName}"
  git checkout ${str_BranchName}
else
  git checkout -b ${str_BranchName}
fi



 

git commit -a -m "Add first draft of some feature"

git push --set-upstream origin ${str_BranchName}