-
Notifications
You must be signed in to change notification settings - Fork 19
Updating a Branch
TheElectricDream edited this page Sep 25, 2021
·
3 revisions
There are two ways to update a branch: merging and rebasing. For students, we recommend not to rebase your branch. Instead, please use the merge function:
- In the GitHub Desktop application, with the SPOT repository selected and your branch selected, click on Branch -> Update from main. This will update your branch with any updates from the master branch.
- Once done, you should see a message indicating the update was a success, as well as a prompt to "Push" the change to your branch (remember, update simply copies any updates to your branch, but the changes have not actually been pushed - i.e. saved - to your personal branch yet).
- After pushing the changes to your branch, you are done!
Updating is rarely this cut and dry, however. It is possible that new code in the master branch will introduce something that will conflict with any code you have already modified on your branch. Generally, GitHub is quite good at pointing out the conflict it can't resolve, but this can take some practice. Don't panic, the beauty of GitHub is that you can always revert back to any previous commit, so nothing is ever permanently gone!