Avoid repeated merge conflicts

Fixing Merge conflicts repeatedly is really bothersome. 

Suppose your team is working on various feature branches at the same time. Now you want to merge all of them together. There are several merge conflicts, which you resolve. But it turns out that one of the branches isn’t quite there yet, so you decide to un-merge it again. After few days when the branch is finally ready,you merge it again, but thanks to the recorded resolutions, you won’t have to resolve the same merge conflicts again.

// Add it to your global config to enable it for all projects
git config --global rerere.enabled true

Common Git Problems and Their Fixes

Git is a free and open-source version control system. These days git is being extensively used and therefore this article focuses on some of the common Git tricks that everybody at some point of time requires while working with git or Github.

Sometimes the user makes some mistakes while working on Git which results in the loss of information or wrong information being added. To overcome this problem, Git provides some methods/tricks to roll back or modify the changes that were made wrong or made by mistake. Some of these problems along with their fixes are listed below:

Table of Content

  • 1. Edit a commit message
  • 2. Undo the local commits
  • 3. Reverting pushed commits
  • 4. Avoid repeated merge conflicts
  • 5. Find a commit that broke something after a merge

Similar Reads

1. Edit a commit message

Sometimes while writing the commit message, we make a typing error. The following commands can be used to fix the issue. Note that the below command creates a new commit so avoid using –amend for modifying commits which have been already pushed to a central repository....

2. Undo the local commits

Sometimes we realize that there is some error /mistake but by that time a few of the changes are committed locally....

3. Reverting pushed commits

Sometimes faulty commits do make it into the central repository even after amend and rebase. Therefore you can use the below commands...

4. Avoid repeated merge conflicts

Fixing Merge conflicts repeatedly is really bothersome....

5. Find a commit that broke something after a merge

Sometimes there is a need to find a commit that changed the project wrongly. This bad commit is difficult to find and hence consumes a lot of time. Git has introduced a method to find this commit which broke something after the merge:...

Contact Us