I have created a new issue branch from main branch.
git checkout main
git pull origin main
git checkout -b issue-1
git add.
git commit -m "feature: test1"
git push origin issue-1
git checkout staging-testing
git cherry-pick (revision no from "feature: test1" commit)
git push origin staging-testing
The problem I’m having is now I have to make change to issue-1 branch.
made change, pushed it to origin issue-1 branch but have difficulty pushing to origin staging-testing without using force.
In my issue-1 branch
git add .
git commit --amend --no-edit
git push --force
While merging what should I do so that
- new commit message is not created
- integrate the changes from issue-1 branch
- push the changes to staging without using force.
I tried git rebase to origin/staing. Then merged the changes from issue-1 branch. Then tried to push it to staging. Every time it show branches diverged error. can’t push without using force. What’s the fix? How to better understand this things? Any refernces with addition to solution for this problem is appreciated.