_D'ĭoc about git rebase -onto, which is more or less your situation:įrom here, merging the changes in master into the branch is easy. I needed to fix some conflicts since I modified at the same places in B and D, but I think you won't. Rebases commits from C (excluded) to master, onto A. I just tested this, with appropriate results: $ edit test.txtįrom here you have the situation you described. You can use rebase to do that in one step: git rebase -onto A C D I want to be able to keep developing the branch and merge any changes from the master into it to keep it up to date, but if I do that the stuff I did to create F will be merged in and cause the files to be deleted and the edits to be reverted. I didn't have time to work out the best method to deal with this, so I deleted the files which the branch added, and manually reverted a few edits made in the branch then commited the result for deployment ( F) A_C_D_F Note: none of the same files that were edited in the branch have been edited in the master. Undoing Commits & Changes git checkout git clean git revert git reset git rm In this section, we will discuss the available undo Git strategies and commands. A_C_Dįirstly I'd like to know what I should have done from here to deploy the code as if the merge never happened. Select Commits, then select the title of the commit you want to revert. If you know the merge request that contains the commit: Select Code > Merge requests, then identify and select your merge request. If I hand't merged it that would have been fine. To do this: On the left sidebar, at the top, select Search GitLab () to find your project. Afterwards, you can return to your master. After making some more changes I was at D but found I needed to deploy the code without the changes that happened in the branch. To undo Git stash pop in different scenarios, you can unstage the merge conflicts and save the conflicted merge. Starting with the Master at A I branched and made some changes at B then merged that branch back in (C).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |