Workflow to revert changes from branch dev to master

7
  • Branch dev is automatically mergeado master ; this one for your Instead, you have an automatic deploy application.
  • Branch dev has some changes ahead of branch master and will be discarded.
  • The feature branch incorrectly exited from workflow and was created at
    from master .

What I need to do is:

  • Delete changes from dev and leave it as master

  • Merge% with% as% with%
  • I thought about resetting feature , deleting it and creating it from dev but I do not know if this is the solution for those cases.

    @edit

    After doing dev , master and reset I get the following error because my commit branch has changes saved in push .

      

    hint: Updates were rejected because the tip of your current branch is   behind

         

    hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again.

         

    hint: See the 'Noteabout fast-forwards' in 'git push --help' for details.

        
    asked by anonymous 10.06.2016 / 22:26

    1 answer

    3

    What I suggest in this case:

    1: Reset the dev branch to the master state. See documentation > the difference of flags --soft , --mixed (default) and --hard .

    git reset master
    

    2: Create a backup Stash with those changes that occurred in those reversed commits, which are now in your working copy

    git stash
    

    As an alternative to stash, you can create a feature branch at the C6 commit point, by reversing only the branch branch marker. No problem this branch is "disintegrated" from the master.

    3: Force a merge of the branch feature into the branch dev

    git merge feature --no-ff
    

    The --no-ff flag will avoid merge fast-forward, and force a merge commit between the two branches. As you have a somewhat structured development / release workflow, it is recommended in this case to maintain the merges history. The same concern goes for overruns.

    4: After this process, when you are going to push the dev branch, you should do this forcefully, since it will remove commits from the origin.

    git push -f origin dev
    

    It is important that this process is communicated to the entire team, which may have its commits-based branches that will be lost

        
    12.06.2016 / 00:49