The project being worked on has several remote developers.
A new feature was being worked on lets say featureBranch
. Now other developers are on branch dev_1
and dev_2
respectively. They took the pull of the featureBranch
and updated their code and started working on it and pushed their code to the remote over a period of a few days on their respective branches.
Now it was decided that the featureBranch
code had to be reverted to a previous commit without losing the changes. So the developer working on featureBranch
did a checkout
of a previous working commit and created a separate branch lets call it featureRevert
. Now the developer has asked us to integrate our changes that we worked on the past few days into this featureRevert
.
Is there any way to do this without having to manually integrate the changes after creating our own branches from featureRevert
as from what I know taking a pull into dev_1
or dev_2
simply from featureRevert
won't work and won't overwrite the featureBranch
work.
Day 1:
Developer working on featureBranch:
git add -A
git commit -m “Worked on feature day 1”
git pull origin featureBranch
git push origin featureBranch
Developer working on dev_1:
git add -A
git commit -m “dev_1 changes”
git pull origin featureBranch
git push origin dev_1
Developer working on dev_2:
git add -A
git commit -m “dev_2 changes”
git pull origin featureBranch
git push origin dev_2
Day 2:
Same as day 1
.
.
.
Day n (Decided to go back to previous commit on featureBranch to lets say day - 10):
Developer working on featureBranch:
git add -A
git checkout -b featureRevert a9c146a09505837ec03b
git push origin featureRevert
Now whatever code is not present in between the featureRevert
and featureBranch
should be removed from dev_1
and dev_2
. Is there a way to do that using git?