1

Ok, I have a git with the master branch and a altered (twig) branch.

Right now they are in this way:

    Master Update - o  o -> Altered Twig Branch
                    |  |
                    | /
                    |/
  Master Original - o 

Right now, when I change the master, I need to manually incorporate the alterations on the altered twig. But the twig is heavily altered form from the master.

There is a ease way to do this? Or I need to incorporate manually?

  • 3
    Do you want to merge the changes from `Altered Twig Branch` into `master`? `git merge` can do that. – kowsky Jan 15 '19 at 14:08
  • If you only need to apply certain commits from master to the altered branch you can use `git cherrypick ` (executed when on the altered branch). – Robert Jan 15 '19 at 19:02

1 Answers1

0

First, to be comfortable and safe, do a quick backup for your master branch.

git branch backup_master master

Then, as kowsky commented, the general principle is to merge altered_twig into master :

git checkout master
git merge altered_twig

Note : at this point, it is possible (depending on the nature of your changes) that conflicts arise on some files. It is not an error. It's git's way to prompt you for the arbitrary choices it can't do automatically. The point is already documented in the manual, but there are also a lot of good answers here or elsewhere on the web on this subject. (and you can abort the process with git merge --abort)

If the end result isn't what you expect or you want to recover the inital state of master for any reason, just switch back to your master branch :

git branch -f master backup_master
Romain Valeri
  • 19,645
  • 3
  • 36
  • 61