Working with Feature Branch Workflow

How to use the feature branch workflow with a simple example

April 2, 2017 - 1 minute read -
Git

Assuming the project was already initiazed and it is integrated with a remote repository. The following commands show the necessary steps to use the feature branch workflow.

Create a new branch

$ git checkout -b new_feature

Perform the commits

touch new_file.txt #Create or modify a file
$ git add new_file.txt
$ git commit -m "Add new file to the project"

Push the new branch to origin

$ git push origin new_feature

Operations on Github

  1. Go to https://github.com/your_repository/your_project/branches and click in “New Pull Request button”. New PR

  2. Create a new Pull Request. Create PR

  3. Merge the changes in the master branch. Merge PR

Update the local master branch

$ git pull

Now the changes done in new_feature branch are available in the local master.