- Make sure all changed files are committed on feature-branch
- Rebase on your feature-branch =>
git pull --rebase upstream master - Switch to your master branch =>
git checkout master - Rebase on your master =>
git pull --rebase upstream master - If there are changes then push changes to master =>
git push origin master - Go back to feature-branch =>
git checkout feature-branch - Push changes from feature-branch to github =>
git push origin feature-branch - Submit pull-request on github
- After pull-request is accepted, delete feature-branch from Github to clean up github history
- On command-line switch back to master branch =>
git checkout master - Rebase from master branch =>
git pull --rebase upstream master - Push changes to your master =>
git push origin master - Delete feature-branch =>
git branch -d feature-branch - Create new branch =>
git checkout -b new-feature
- You would currently be working on your feature-branch. Do a git branch to check
- Do a
git statusand commit any of your unstaged changes - Rebase from feature-branch =>
git pull --rebase upstream master - Switch to master branch and rebase =>
git pull --rebase upstream master - Push updated changes up to github origin-master =>
git push origin master - Move Back to feature-branch =>
git checkout feature-branch - That’s it!