Here is steps
- Check out your own forked repository
git clone git@github.com:aidabo/Ghost.git
- Link your local fork to the original repository to fetch updates:
git remote add upstream https://github.com/TryGhost/Ghost.git
- Pull all branches, tags, and commits from the original repository:
git fetch upstream --tags
- Create a branch based on the upstream tag (e.g., v5.116.2):
git checkout -b new-upstream-version v5.116.2
- Rebase Your Custom Code onto the New Version
Rebase to apply your changes on top of the latest upstream code
(here git checkout custom-feature custom-feature is main, can be branch and tags):
git checkout main
git rebase new-upstream-version
Resolve conflicts during rebase, then continue:
git rebase --continue
- Resolve Merge/Rebase Conflicts
Git will pause if conflicts occur. Open conflicting files, edit them to resolve discrepancies, then mark them as resolved:
git add resolved-file.js
Complete the merge/rebase after resolving all conflicts and commit.
git commit -m "merged upgraded files"
- Push Updated Code to Your Fork
git push origin main --force-with-lease