![]() ![]() I’ve merged the bug fix branch, deleted it and pushed the master branch to the server. Now imagine that the bug fix is merged into the master branch – it was some urgent fix that we needed to push out to customers. That is the base of each of the branches. Follow the lines on the graph (created with git log –oneline –all –graph) and notice that they all diverge from master at the same commit as before. I’ve got three branches on the go for a couple of new features and a bug fix. | * 176af2d Set field on customer validation | * 445e3e1 (feature/new-field-on-sales-docs) Add field to Order Confirmation | * d88a322 (feature/another-feature) And some more development Now a more complex example: * 412ce8f (HEAD -> bug/some-bug-fix) Fixing a bug in the bug fix In this example commit 3894d1a is the base (“Correct typo in caption”). We can consider that the base of the feature branch is where it diverges from the master branch. * 94388de Populate new Customer field OnInsert * cd03362 Add missing caption for new field * 3894d1a (origin/master, master) Correct typo in caption * 176af2d Set field on customer validation * 445e3e1 (HEAD -> feature/new-field-on-sales-docs) Add field to Order Confirmation Imagine this repository where I’ve created a new branch feature/new-field-on-sales-docs to do some development. Let’s start with identifying the base of a branch before worrying about rebasing. It seems that rebasing can be something of a daunting subject. After the successful rebase, if you still don’t trust the merged CSS, you can recompile it again and squash the new commit with any desired commit.This is part two of a series about using Git to manage your Business Central development. ![]() The next time there is a merge conflict in the CSS or in the map file, it won’t open Meld, it will keep the local version of the file. You can do more complex stuff, you just have mention that in the merge.*.driver. So what we are doing is, we are keeping the local version ( ours) of the conflicting CSS and map files. remote refers to the incoming changes: “theirs” - the current branch before the rebase.local references the partially rebased commits: “ours” (the upstream branch).Since, I am using GUI mergetool Meld, therefore, in a GUI mergetool context: gitattributes file, you just append the above content in the file.Ī rebase switches ours (current branch before rebase starts) and theirs (the upstream branch on top you want to rebase). ![]() We will be creating a custom merge driver. It tells how you can make use of drivers to resolve merge conflicts. The answer states the solution in detail. I googled and found many blogs and StackOverflow links. People in IRC #git channel helped me out with the problem. So, I decided - why should I waste my time, let the Computer do this thing for me. It used to take me around half hour to completely rebase one branch to another, while the “actual” conflict fix took me hardly 2 minutes. But things became more painful when we used to rebase two branches with longer history. So, ~10 * 2 = ~20 seconds, I had to wait for ~20 seconds just to close the Meld and recompile the CSS.Įarlier in the project, there were fewer conflicts while rebasing, so I usually waited for that 20 seconds. And there’s more - we had the compiled CSS styles.css and the map file as well. My problem was - the CSS was also minified, and since it is minified, Meld used to take ~10 seconds, to open up the file in three panes. Well, that is okay unless you don’t want to automate that. you can just close the Meld without doing anything and recompile the CSS. Similarly, it used to open up for the compiled CSS as well. For every merge conflicts Meld, opens up and asks you to resolve them. There were conflicts in the compiled CSS as well. And obviously, there were merge conflicts. We were maintaining multiple branches for multiple features. I was working on a project where we were using Sass for styling. ![]() Bypass Git merge conflicts in compiled CSSĪfter reading this blog you will learn, how you can automate the resolving of merge conflicts for certain files during git rebase. ![]()
0 Comments
Leave a Reply. |