You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dimitar Nikolov edited this page Mar 18, 2026
·
1 revision
Prerequisites
In this tutorial, we will assume the following prerequisites:
That we want to merge into the branch master
That our branch is named test
That our branch has already been pushed to origin, and the PR is approved.
Workflow
Update the main branch:
Switch to the main branch - git switch master
Fetch any updates - git fetch
Pull any new commits so that master is updated to the latest - git pull
Rebase your branch:
Switch to your branch - git switch test
Pull before rebasing in case someone has committed to your branch - git pull
Start the rebase - git rebase master. If you want to squash the commits, use git rebase -i master instead to start an interactive rebase.
After the rebase is over, if there have been no conflicts, you should be able to push the changes - git push. Check with git status git status whether you have any uncommitted changes.
Merge your branch:
Switch again to the main branch - git switch master
Now merge it - git merge test
Push the changes - git push. If it doesn't work, use git push --force