On my deployment workflow I constantly need to make fine testing adjustment in my staging branch, I test things out in there and then open a hotfix branch from main to implement the fix.
The problem is that after merging the hotfix with main I usually end up with a branch history that is incompatible to merge or rebase with my current staging branch.
How can I simply turn my staging branch into a copy of main, without merging?
Since you want your branches to be literally identical you can simply delete your staging branch and create a new "staging" branch from main.
git checkout main
git branch -d staging
git branch staging
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.