Merge tool for linux

Meld Visual diff and merge tool

Meld helps you compare files, directories, and version controlled projects. It provides two- and three-way comparison of both files and directories, and has support for many popular version control systems.

Meld helps you review code changes and understand patches. It might even help you to figure out what’s going on in that merge you keep avoiding.

File comparison

File comparison

  • Compare, edit and merge files using live comparison updates
  • Navigate between changes and operate on change blocks
  • Simple text filtering for ignoring irrelevant differences
  • Three-way merge assistance with conflict handling and base version display

Folder comparison

Folder comparison

  • Identify and manage missing or modified files across folders
  • Drill down into a file comparison for a detailed view of differences
  • Ignore certain files or folders for more useful comparisons

Version control view

Version control

  • Supports Git, Mercurial, Bazaar and Subversion
  • Check your changes, commit and push easily
  • View and manage version control states
  • Tool integration with e.g., git mergetool

Installing Meld

Meld is packaged for most Linux/Unix distributions, and is also available on Flathub. For installing from source, see the instructions.

Windows users should download the MSI. Meld does not yet support automatic updates or portable installs.

Meld is not yet supported on OS X. Third-party binaries are available, and you can install from Homebrew, MacPorts or Fink.

Requirements
  • Python 3.4
  • GTK+ 3.20
  • GLib 2.36
  • PyGObject 3.20
  • GtkSourceView 3.20
  • pycairo

See the current README file for development and build requirements.

Meld 3.22.0 — stable
04 September 2022

The most recent stable release is the best option for most users. We keep changes to these releases to a minimum.

See the full release list for details of previous versions, or you can download old source archives or Windows installers.

Contributing

All development happens on GNOME’s Gitlab instance. Please open an issue for any problems you encounter, and feel free to ask on the discussion board if you’re uncertain about anything.

Developing

You can run Meld directly from your git clone, without installing:

$ git clone https://gitlab.gnome.org/GNOME/meld.git $ bin/meld

Internationalization support

Meld is available in several languages thanks to the epic efforts of many wonderful translators. If you’d like to contribute translations, please contact the GNOME Translation Project.

Читайте также:  Linux file manager install

Источник

The Top 5 Diff/Merge Apps for Linux

Keeping track of the changes that have been made to multiple files during your course of work can be tricky. It is one of the reasons Git is famous for its version control and diff-merge feature.

But what happens to those who don’t work version control systems but still want to keep track of file changes and history versions? They need diff/merge applications.

Merge applications have the ability to compare file content side by side and highlight their differences to either merge and add the changes or truncate them.

In this article, we will share top 5 diff/merge applications for the Linux platform:

1. P4Merge – Visual Merge and Diff Tools

P4Merge shows the differences between both text and image file versions and their change history using color syntax and 4 responsive panels – Base, Local, Remote, and Merge_Result. It has the option to exclude whitespaces and line endings in Mac, Linux, and Windows.

P4Merge Diff/Merge Tool

You can display images side by side or overlay them to see the pixel-level changes and it has support for various image formats including BMP, JPEG, GIF, and TIFF, among others. P4 Marge is closed source.

2. Beyond Compare – Reconcile Your Differences

With Beyond Compare you can quickly compare files and folders at high speeds and even use commands to concentrate on comparing only the areas of the files or folders you want to work with. It allows custom comparison templates for different file types, remote folder comparison, and keyboard shortcuts.

Beyond Compare Diff/Merge Tool

Beyond Compare has a free version available for use and a paid subscription table for users interested in extra features.

3. SmartGit – Get Your Commit Done

SmartGit is actually a Git client with special integrations for GitHub, BitBucket, and Atlassian Stash, but it also comes with a diff/merge feature that allows you to view line by line differences between files with support for color syntax and version history.

SmartGit Diff/Merge Tool

SmartGit offers free terms of use for non-commercial users i.e students, Open Source authors, etc.

4. Kdiff – Diff and Merge Program

Kdiff is an awesome stand-alone diff/merge tool that lets you compare two or three text files or directories to display the differences line by line and character by character. Its editor allows for manual line editing and version history merge among many other features.

Kdiff Diff/Merge Tool

Kdiff is also able to compare whole directory trees, and since it is FOSS, you can download it and get to using it right away.

5. Meld – Visual Diff and Merge Tool

Meld is a visual diff and merge tool built for developers. With it, you can compare files and directories and even launch file comparisons within the folders. Meld is a stand alone FOSS that can be integrated with all the popular version control applications in the market.

Читайте также:  Cpu x linux установка

Meld Diff/Merge Tool

My favorites are Kdiff and Meld because they are the most stand-alone apps on the list. They pack more features, are cross-platform, and are FOSS.

Maybe I didn’t mention your preferred difference and merging application, feel free to add your suggestions in the comments section.

Источник

Обзор инструментов для визуального сравнения и разрешения конфликтов слияния

На хабре уже было много статей о распределенных системах управления версиями (DVCS), их сравнений, а также сравнений GUI-клиентов для них. Также были обсуждения плагинов к IDE для работы с git и mercurial. Но практически не было информации об инструментах визуального сравнения и разрешения конфликтов слияния.

diff and merge

Недавно я «перескочил» с mercurial (который до сих пор считаю более удобным и логичным) на git, потому что, подавляющее большинство проектов, которые мне интересны, используют git и хостятся на github. В связи с этим, встал вопрос о пересмотре арсенала инструментов, в частности вопрос выбора инструмента визуального сравнения и слияния (diff and merge). Дабы восполнить недостаток информации на хабре, я решил написать этот мини-обзор. Как говориться — по горячим следам.

KDiff3

  • бесплатен;
  • поддерживает трехстороннее слияние;
  • умеет сравнивать директории;
  • с различными кодировками работает нормально;
  • без дополнений не подсвечивает синтаксис.

DiffMerge

  • бесплатен;
  • поддерживает трехстороннее слияние;
  • умеет сравнивать директории.
  • бывают проблемы при работе с кириллицей. Думаю, со временем, исправят.
  • DiffMerge по умолчанию, не поддерживает подсветку синтаксиса языков программирования.

WinMerge

  • Open Source;
  • никаких проблем с кодировками;
  • подсветка синтаксиса без лишних телодвижений;
  • сравнение директорий.
  • инструмент слияния является двусторонним, что может создавать неудобства в некоторых случаях;
  • Windows only.

Meld

  • GPL v2;
  • двустороннее и трехстороннее слияние файлов;
  • сравнение директорий;
  • подсветка синтаксиса (при установленном GtkSourceView).
  • для установки под Windows требуется установить Python, GTK+, Glib, GtkSourceView, что не каждому понравиться.

Diffuse

  • GPL;
  • поддержка 2-way, 3-way и n-way (произвольное количество файлов) слияния;
  • подсветка синтаксиса;
  • отлично работает с UTF-8;
  • неограниченная глубина отмен (Undo);
  • удобная навигация по коду.
  • разве что, невозможность сравнивать директории.

TKDiff

  • GPLv2;
  • можно добавлять закладки для различий;
  • с кодировками работает нормально;
  • интерфейс менее удобен и выглядит очень бедно (см. скриншот), чем у других продуктов.
  • нет подсветки синтаксиса;
  • не умеет сравнивать директории.

SmartSynchronize

  • трехстороннее слияние;
  • нет проблем с кодировками;
  • помимо файлов, может сравнивать директории.
  • для коммерческого использования требуется лицензия;
  • подсветка синтаксиса для языков программирования по умолчанию не предусмотрена. Не исключено, что можно как-то сделать.

BeyondCompare

  • трехстороннее слияние;
  • может сравнивать файлы, директории, удаленные директории, архивы, а также MP3-файлы, изображения и др. Но последние пункты — это в принципе не нужный функционал.
  • ShareWare;
  • нет версии под Mac.
Читайте также:  Best linux all in one desktop

Araxis Merge

  • трехстороннее слияние;
  • нет проблем с кодировками;
  • подсвечивает синтаксис;
  • помимо файлов, может сравнивать директории и синхронизировать их;
  • хорошо работает на сравнении больших файлов (гигабайты) и больших директорий;
  • генерация отчётов по результатам сравнения.
  • Ribbon-интерфейс (если это можно назвать плюсом).
  • ShareWare;
  • нет версии под Linux.

Git и DiffMerge

1) Добавим в директорию c:/Git/libexec/git-core/mergetools/
файл diffmerge следующего содержания:

diff_cmd () < "c:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe" \ "$LOCAL" "$REMOTE" >/dev/null 2>&1 > merge_cmd () < "c:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe" \ --merge --result="$MERGED" "$LOCAL" "$BASE" "$REMOTE" >/dev/null 2>&1 status=$? > 

2) Теперь добавим в файл c:/Users/swipe/.gitconfig
следующие строки:

[diff] tool = diffmerge [merge] tool = diffmerge [mergetool "diffmerge"] cmd = "diffmerge" trustExitCode = true 

3) Создадим конфликт и вызовем DiffMerge для его разрешения

git init // инициализируем репозиторий создадим пустой файл readme.txt git add . // добавим созданный файл в индекс git commit -m "empty readme" // зафиксируем изменения git branch new // создадим новую ветку git checkout new // переключимся на новую ветку добавим строку в файл readme.txt git add . // добавим изменения в индекс git commit -m "new string" // зафиксируем изменения в новой ветке git checkout master // переключися на master ветку добавим изменения в файл readme.txt git add . // добавим изменения в индекс git commit -m "master string" // зафиксируем их git hist --all // посмотрим на дерево 

tree

git difftool master new // сравним две ветви

diff

git merge new // сольем изменения в new с веткой master

conflict

Выводится сообщение о конфликте слияния, чего мы и добивались.

git mergetool // разрешим этот конфликт

merge

В среднем окне, приведем файл к требуемому состоянию и сохраним изменения.
Конфликт разрешен.
Настройку DiffMegre подсмотрел тут:
http://twobitlabs.com/2011/08/install-diffmerge-git-mac-os-x/

Git и WinMerge

1) Добавим в директорию c:/Git/libexec/git-core/mergetools/
файл winmerge следующего содержания:

diff_cmd () < "c:/Program Files (x86)/WinMerge/WinMergeU.exe" \ "$LOCAL" "$REMOTE" >/dev/null 2>&1 > merge_cmd () < "c:/Program Files (x86)/WinMerge/WinMergeU.exe" \ "$PWD/$LOCAL" "$PWD/$REMOTE" "$PWD/$MERGED" >/dev/null 2>&1 status=$? > 

Когда Git не может автоматически объединить изменения, происходит конфликт слияния и в конфликтующий файл добавляются маркеры слияния (>>>>>>). Они необходимы для разрешения конфликта с помощью сторонних инструментов.
Рассмотрим файл readme.txt который образуется в результате выполнения слияния веток master и new в приведенном выше примере:

Мы можем открыть файл конфликтов с помощью программы WinMerge для разрешения конфликта.

open

После этого откроется средство двухстороннего слияния:

winmerge

Исходя из описанной логики перепишем команду слияния merge_cmd следующим образом:

merge_cmd () < "c:/Program Files (x86)/WinMerge/WinMergeU.exe" \ "$MERGED" >/dev/null 2>&1 status=$? > 

По сути, оба приведенных варианта эквивалентны.

2) Отредактируем .gitconfig

[diff] tool = winmerge [difftool "winmerge"] cmd = "winmerge" [merge] tool = winmerge [mergetool "winmerge"] cmd = "winmerge" trustExitCode = false keepBackup = false 

последняя строчка отменяет сохранение backup-файлов в директории репозитория.

3) Создадим конфликт при слиянии двух веток (см. пример с использованием DiffMerge).

git difftool master new // сравним две ветви

windiff

Для разрешения конфликта при слиянии веток, воспользуемся командой

Источник

Оцените статью
Adblock
detector