This file relates to both GitHub and GitLab.
The following guide shows you how to update your current branch with code from another branch that may have more commits since you have branched off it
This is extremely useful in the case where you may be working on your own branch and in the meantime the master branch has been updated. By rebasing, you are able to test
your code against the latest code as well as preemptively ensuring that your PR will not fail to merge. Console usage is required
Speaking of which, if your PR fails to merge, rebase your branch against the
parent branch you are merging your branch to (should be the master branch) and push your branch again (check the "Force Push" checkbox in the Push window if it fails to push)
git rebase "branch name", replacing "branch name" with the name of the branch you are rebasing from (in the case of the picture below, it is the master branch we are rebasing from)
git fetch origin # Fetches from origin (replace origin with your remote) git checkout "branch" # Checks out the branch git pull # pulls the branch git checkout "yourbranch" # Go back to your branch git rebase "branch" # Rebase against the other branch