Skip to content

How to work off of a feature branch

ruqpyL2 edited this page Jun 20, 2021 · 14 revisions

This guide is describing how to set up your local branch while working off of a feature branch.

Step 1: Create your branch

  • Fetch the most recent changes on the upstream remote
    git fetch upstream
  • Create the local branch off of the upstream remote branch
    # example: git checkout wins-feature-1
    # {FEATURE BRANCH NAME} needs to be identical to the feature branch name on the upstream remote repo
    git checkout {FEATURE BRANCH NAME}
  • Create your new branch!!
    git checkout -b {YOUR BRANCH}

Step 2: Update your branch with upstream changes

  • Update the branch with the latest changes using the following command
    # example: git pull upstream wins-feature-1
    git pull {NAME OF REMOTE} {NAME OF REMOTE BRANCH}

Step 3: Create a pull request

  • Stage and commit your changes
    git add {FILES CHANGED}
    git commit -m "{COMMIT MESSAGE}"
  • Push changes to your remote
    # this is the same as always
    git push origin {NAME OF YOUR LOCAL BRANCH}
  • Create a pull request that is comparing across forks, from your branch to the feature branch
Clone this wiki locally