Как подключить Git к Help+Manual Professional


ПО

Git-2.45.2-64-bit

WinMerge-2.16.32-Setup


Порядок настройки

1) Установить Git. При установке обязательно указать три опции (см. ниже) в соответствии с официальной документацией производителя Help+Manual:

Every user needs to install Git

You need to get the official Git for Windows from the weblink central Git site. There are a number of choices you need to make while installing. See weblink this guide on phoenixNAP for good recommendations.

Important settings while installing

For working with Help+Manual, there are some important settings you should make while installing Git:

-- Set "main" as your default initial branch

By default, Git will want to set "master" as the initial branch. However, most people now use "main", and this is also how Help+Manual is set up. So select the option to override the default branch name and change it to "main".

-- Git from the command line and also from 3rd-party software

This option is essential for integration with Help+Manual and must be selected.

-- Checkout Windows-style line endings

This should be selected for work with Git in Windows and Help+Manual.

All the other settings can be left as their defaults.

2) Инициализировать локальную копию как репозиторий. В powershell из папки проекта выполнить команду:

git init

3) Установить Winmerge.

4) Настроить Winmerge в конфигурационном файле gitconfig (см. ниже настройки). Путь к файлу C:\Users\<username>.

5) Донастроить связь локальной копии с веткой main главного репозитория: в powershell ввести необходимые команды, указать путь к центральному репозиторию. Для этого выполнить команды в локальной ветке:

git remote add origin https://example.security.ru/Security/_git/Documentation>

git branch

git switch -c main

git branch

git pull origin main

git branch --set-upstream-to=origin/main (если возникает ошибка upstream при первом commit из Help+Manual)

6) Подключить Git к Help+Manual в настройках Help+Manual Program Options: указать путь к файлу git.exe.


Данные

Пути:

C:\Program Files (x86)\WinMerge\WinMergeU.exe

C:\Users\<username>\AppData\Local\Programs\Git\bin\git.exe

C:\Users\<username>\.gitconfig

Конфигурация WinMerge:

[mergetool]

prompt = false

keepBackup = true

keepTemporaries = false

[merge]

tool = winmerge

[mergetool "winmerge"]

name = OneMerge

trustExitCode = true

cmd = "'C:/Program Files/WinMerge/WinMergeU.exe'" -u -e -fm -wl -dl \"Local\" -wr -dr \"Remote\" \"./$LOCAL\" \"./$BASE\" \"./$REMOTE\" -o \"./$MERGED\"

[diff]

tool = winmerge

[difftool "winmerge"]

name = WinMerge

trustExitCode = true

cmd = "'C:/Program Files/WinMerge/WinMergeU.exe'" -u -e \"./$LOCAL\" \"./$REMOTE\"