Conflict Resolution in Git

Asked

Viewed 2,326 times

0

Good afternoon I work with the Git version manager, and in turn when merging I come across complicated conflicts to resolve. Is there a tool that can somehow better deal with these conflicts? The ideal would be a tool that allows you to organize the code and put it in "specific lines". For example when merging with a code that is in master and there are functions that have spaces some of these spaces are filled by my code, and was not supposed.

1 answer

1


Everything I need to do with Git, I use on Gitkraken. It is a tool with an interface for several (if not all) Git’s, diverse facilities and speed to perform Git activities, compared to bash, as:

  1. auto-stash of your files, if you have changes when changing branch;
  2. Ease to follow the pattern Gitflow;
  3. Standardized merges messages throughout the project;
  4. Ease in clicks on buttons like undo, redo, pull, branch, stash, pop;
  5. Better visibility of the entire flow as well as the history of commits, in comparison to gitk;
  6. Ease to perform commits, and check each line that has been added/removed;
  7. Ease to ignore files and/or select only few files to commitar;
  8. Ease to discard all changes performed on various files.

These are the main ones I use, but there are more features...

Regarding the merge, it has a merge tool that splits the screen in two, where the left is your changed file, and on the right is the file that is coming from develop, in the case of a merge of your branch in develop. One can then select a block, or click row to row, and at the bottom shows the final file.

All conflicts accomplished, just click on Commit and merge files the merge is performed, then the push with a simple click on the button.

Below is an image that demonstrates this better:

mergetool

There is also another similar tool, the Sourcetree. It is similar to Gitkraken, but the downside is that there is no Linux, just Mac or Windows, so I particularly ended up not using this.

Today even the editors themselves, such as Visual Studio Code, there is an own tool to resolve conflicts of merge, where you can click on links, or make the change manually, with better visibility on the lines that are coming from the branch you are doing the merge, and the branch you’re on.

Follow an image below that shows it better:

vscode

Browser other questions tagged

You are not signed in. Login or sign up in order to post.