Reputation: 237
I have a git project. let's assume I am on side branch and I made a bug fix (Bug #XX) After delivery I discovered another another issue related to Bug #XX. Now I will have in git 2 commit referring bug #XX.
Let's say another developer also have a side branch and he want to cherry-pick my Bug #XX fix.
Is there a way to say git to bind this 2 commits as 1 commit. So when you cherry-pick one it will take both?
Of course I know I can cherry-pick them to a new branch and squash them to one commit. But I am assuming my side branch as master from which I deliver the product.
Is there a way to bind those two commits? And create a dependency between them?
Upvotes: 1
Views: 637
Reputation: 83577
No, there is no feature to mark separate commits as "related" in git.
There are, however, several ways to handle this situation:
git rebase -i
(note that this rewrites history, so the usual caveats apply).The best solution, however, will depend on your git workflow (stable master + feature branches, unstable master + release branches, both, gitflow...). If you need a more specific answer, you will have to explain your workflow.
Upvotes: 1