-
-
Notifications
You must be signed in to change notification settings - Fork 843
How to work off of a feature branch
Jessica Cheng edited this page Jul 16, 2022
·
14 revisions
This guide describes how to set up a local branch while working off of a feature 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 -b wins-feature-1 upstream/wins-feature-1 # {FEATURE BRANCH NAME} needs to be identical to the feature branch name on the upstream remote repo git checkout -b {FEATURE BRANCH NAME} upstream/{FEATURE BRANCH NAME}
-
Create your new branch off of the new feature branch that you just created!!
git checkout -b {YOUR BRANCH}
- Update the branch with the latest changes using the following command
# example: git pull upstream wins-feature-1 git pull {NAME OF REMOTE} {FEATURE BRANCH NAME}
- 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 {YOUR BRANCH}
- Create a pull request that is comparing across forks, from your branch to the feature branch
- The into branch should be the feature branch you based your local branch off in Step 1: Create your branch. As an example, continuing from the example given in step 1, the into branch for that pull request would be set to
hackforla:wins-feature-1
.
- The into branch should be the feature branch you based your local branch off in Step 1: Create your branch. As an example, continuing from the example given in step 1, the into branch for that pull request would be set to
Click the arrow below each category to view links (or view original alphabetical list by clicking "Pages" above) :