Savita Seetaraman

Savita Seetaraman

Git Flow: Feature branch workflow

One of many ways of efficiently managing the git source code repos is the Feature branch workflow. In this method, we create a new branch for every feature or issue we are working on. After the pull request has been approved, the commits are merged into the master branch. This means that the master branch does not contain any broken code and at any point, runs/builds. As a result, all the development takes in place in other branches. Some advantages of this approach are:

  • Work on separate features is separate, without conflicts between developers working on separate features.
  • The master branch always contains code that is not broken. It can be cloned and run.
  • One can ask for feedback or review in the middle of a feature development, by opening a pull request in the feature branch.

Git Steps

git checkout main 
git fetch origin
git reset --HARD origin/main

git checkout -b feature_branch

git status
git add file_name
git commit -m "message"

git push -u origin feature_branch