Skip to content

Rebase Process Against Element iOS

Yoan Pintas edited this page Apr 26, 2022 · 10 revisions

Rebase Process

Goal

Get news Element features / bugfix / security fix .

Theses features could be integrated or hidden in Tchap.

It is recommended to do rebases regularly in order to avoid having big conflicts.

/!\ Choose a stable release version.

This method will help you during the PR review. You will have the possibility to compare the conflicts commit with the resolve commit.

First setup

Create branch from develop (this branch will have to be regularly updated): "element-rebase". We will merge all the rebases in this branch and after the branch will be merged in develop.

TODO for each rebase

Add upstream (element-ios) remote repository) if you don’t have it

git remote add upstream git@github.com:vector-im/element-ios.git --no-tags

Fetch specific tag from upstream repository

git fetch upstream tag vX.X.X

Create a new branch from origin (Tchap-ios) element-rebase

git checkout origin/develop -b rebase/element-ios-X.X.X

Merge the last element-android release in Tchap-ios

git merge vX.X.X

Please RESOLVE conflicts or/and FIX build issue then stash to apply them later.

git stash -u

Restart your merge and commit without doing any changes and with the template message "Merge vector-im/element-ios vX.X.X into element-rebase"

git merge --abort

git merge vX.X.X -m "Merge vector-im/element-ios vX.X.X into element-rebase"

git add .

git merge --continue

Apply your changes and add them

git checkout -- stash .

git add .

git commit -m 'explain your changes here'

Remove tags coming from element

git tag --merged upstream/main | xargs git tag -d

git tag --no-merged develop | xargs git tag -d

Push your branch on the repository

git push origin rebase/element-ios-X.X.X

Create a pull request to merge your branch into element-rebase. (Dont squash element commits: we want to preserve the git history)

When you PR is approved, you can squash your commits; only your merged commits not the element commits.

git rebase -i HEAD~2

git push origin rebase/element-ios-X.X.X --force-with-lease

When PR was merged you should add a tag on the commit to checkout easily this merge in the future if necessary.

git checkout develop git tag element\_vX.X.X

git push origin refs/tags/element\_vX.X.X

Well done ! You have successfully merged element-ios in Tchap-ios.

Clone this wiki locally