...
- Clone an up-to-date version of the broken branch
git commit --ammendamend
--signoff
and ensure the appropriate Sign-off is included in the commit message- Visit https://github.com/hyperledger/besu/settings/branches and change the glob to no-longer match the branch that is about to be force-pushed to
git push --force-with-lease origin mastermain
- Return the branch protection glob to the old value
- Announce the change in the contributors channel a message like "The head of `master` `main` branch for repository `hyperledger/besu` has been rebased to deal with a DCO issue, please follow the instructions on 24781758 Fixing DCO on main/release to fix your local repositories"
...
git fetch origin
git branch -f master main origin/mastermain
if your local master main is based off the upstream mastermain- (Optionally)
git push --force FORK mastermain
if you are keeping your fork's master main up-to-date - For all branches based on the bad checkout:
git checkout $BRANCH
git rebase --interactive mastermain
- Remove the old master main commit from the list
Sometimes you might get DCO issues on a release branch when you're merging new commits in, fix it following a similar process:
git checkout release-22.1.x
to checkout the release branch at the last releasegit merge main
to merge in desired commits (use git reset --hard xxxx to set main at a desired commit)git rebase -i HEAD~10
to initiate a interactive rebase, replace 10 with the number of commits back that has DCO issues- In the rebase file find the commit hashes with DCO issues, replace the '
pick
' with 'edit
' - You might also need to fix some merge conflicts as the rebase happens, should be straight forward
- When the rebase stops at your desired commits, run
git commit --amend --no-edit --signoff to signoff
the commit - Run
git rebase --continue
to continue, repeat steps 5-6 until done - Push the changes with
git push --force-with-lease origin release-22.1.2