Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

How to Create Feature Branches

Bryan Masamitsu Parsons edited this page Sep 25, 2018 · 1 revision

HOWTO Create a Feature Branch

This assumes you already have a clone of the repo in question.

Simple recipe:

  1. Update master branch git checkout master; git pull origin/master
  2. Create new local branch: git checkout -b issue_99 master
  3. Develop and commit code on new branch: git commit -m "Did stuff"
  4. Setup local tracking and push to remote server: git push -u origin issue_99

Detailed recipe:

  1. Inspect your local and remote branches
    • $ git branch -av
  2. Update master branch
    • git checkout master
    • git pull origin/master
  3. Create new local branch issue_99 based on your local branch master
    • git branch issue_99 master
  4. Checkout the new local feature branch
    • git checkout issue_99
  5. Make changes to files on the new feature branch, and commit them
    • echo "Hello World" > README.txt
    • git add README.txt
    • git commit README.txt -m "Documentation, initial commit of README file"
  6. Push your feature branch up to the Github GPSTk repo and set-up local tracking
    • git push -u origin issue_99
  7. Confirm that your new feature branch is present
    • git branch -av
  8. Confirm that your local branch tracks the remote branch
    • git remote show origin