简体   繁体   中英

How to deal with temporary changes for bug fixing in git?

I needed to change something in my code to reproduce a bug (I work on a bug fix branch). I've already found a fix but now I don't know how to proceed with the changes I made to reproduce it.

My teammates have to review and test my fix. Therefore they also need the changes I've made so that they are also able to reproduce the bug itself and check whether my changes really fix it or not.

In our workflow, after someone fixed a bug, they commit and push everything to the bug fix branch and then create a pull request to merge this branch into the develop branch. If the last reviewer also accepted the pull request, the branch get merged into development.

On the one hand I don't want these "bug reproducing changes" to get merged into development, so I thought about not pushing them - but on the other hand they other reviewers need them.

How can I solve this problem? I know that git offers the possibility to cherry pick certain commits, but therefore someone has to do it manually. Isn't there a way to mark a commit as "not mergeable" or something?

Best regards, winklerrr

I would create a bug-reproduce branch, and push that. Then others can pull it an examine it without being tempted to merge it into the main dev branch.

If your workflow is flexible enough to push a unique branch to contain the bug-reproduction code, then that would probably be the easiest approach.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM