I would like to ask my seniors how to restore the code after the Pull Request on Github is Revert?
给我你的怀抱
给我你的怀抱 2017-05-02 09:25:28
0
1
644

Please tell me how to restore the code after the Pull Request on Github is Revert?

The scenario is as follows:
There are now 2 branches, one is the pre_release branch and the other is the feature_order feature branch

The steps are as follows:
1. Now I have made modifications on the feature_order feature branch, and then used the Pull Request operation on GitHub
2. The pre_release pre-release branch agreed to the Pull Request request and merged the code
3. But something happened at this time, and Revert needs to be performed. Use the Revert function on GitHub to pull the Pull Request to Revert

The symptoms are as follows:
1. After Revert, the feature_order feature branch pulls the code from the pre_release pre-release branch to the local Merge merge, and it is found that the code of the previous Pull Request has been deleted
2. If it is not downloaded from pre_release When you pull the code from the pre-release branch, you cannot perform the Pull Request operation again. It shows that there is no change. This should be related to the CommitId, because Revert initiates a new Pull. The Merge performed after the Request, the previous Merge is already in history, so it seems reasonable without any changes

Unless the Commit generated by the Pull Request just initiated by the Revert operation is revert again in the pre_release pre-release branch, that is, the "undo" operation is revoked, in this case, the code that you want to withdraw will be put into pre_release again. Only the pre-release branch can be restored...

What I want is that the code on the feature_order feature branch will not be deleted. I can initiate a Pull Request for the pre_release pre-release branch, and the code will not be deleted after the withdrawal

Excuse me, seniors, what should I do? It’s really an endless loop with no solution...

给我你的怀抱
给我你的怀抱

reply all(1)
迷茫

My method of handling this kind of thing is rather rough. I usually don't use revert but reset. I just reset the pre_release branch to the hash before the pull request.
We also recommend two commands: cherry-pick and rebase, which are very useful when dealing with this kind of error operation.
Attached is another article of my diary: http://leo108.com/pid-2026.asp

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template