There is a repository with the project. I made the necessary edits, implemented new features. All this was done in a separate thread with the number of task 5131 (Git Flow). Then, I sent all commits to pull request, after which they were merged into the develop branch. Now there is a need to refine the code in 5131 by adding a new functionality. How best to proceed, create a branch 5131-1 where to add the necessary features or start a separate task with your branch?
2 answers
I understand that both options look so-so.
Doing another branch for the same task (if you really continue it rather than doing a new related task) may not be desirable for aesthetic reasons: do not keep more than one branch for each feature in one repository.
On the other hand, if there are no changes in this thread after accepting a pull request, the risk of grabbing a merge conflict is high when the time comes to do a merge of debugs, if something else was happening before develop .
Provided that your repository is conducted "conservatively" (without constant rebase in order to get rid of tangled commit trees) ...
You can combine!
You can make the develop in feature/5131 merge (exactly in the opposite direction!), And then continue working in the same branch as usual.
So the work on the feature continues in the same branch, but at the same time conflicts with changes already known at the time of the start of completion, will be impossible, because the work will begin with the most recent state and destroyed conflicts (if they were).
- Is it possible to commit to a branch after pull request? - QuaternioNoir
- @QuaternioNoir of course. The request is made from a branch to a branch, the push of new commits to the feature branch will add them to the request. - D-side
- @QuaternioNoir, firstly, pull request is not a team of the gita, but a superstructure. It can be implemented in different ways. Or an indication of a branch or an indication of a specific commit (the last in a branch at the time of the request). In the second case, it is possible. What mechanism is used - you did not specify. - German Borisov
- Secondly, if a merge occurred, then your request has already been processed. - German Borisov
- TFS and Git Flow. - QuaternioNoir
If the interpretation of the task has changed and you need to complete, redo, and especially if you need to fix the functionality in the received pull request, you first need to revert to the received requester.
$git revert #merge-hash -m 1
This way you will protect other developers of the team from using incorrect code.
Then you need to perform a merge in the fiche branch of the rover and then perform a revert of the so-called revert of the so-called. double rover A double rover is needed so that your changes become determined in the general branch develop. Without it, git will not be able to add negative changes. After you finish / redo / correct the code for the task, you can once again execute the pull-request.
You can read more about the double rover and similarity here.
- Use common analog terms in Russian or originals in Latin letters. "Survive, devert" - not everyone will understand. - 0xdb