Windows에서 Meld와 Git mergetool
Linux에서 내가 가장 좋아하는 병합 도구는 Meld이며 Git과 함께 작동하도록 사용하거나 구성하는 데 문제가 없었습니다. 그러나 Windows에서는 다른 이야기였습니다.
먼저 https://code.google.com/p/meld-installer/ 에서 찾은 번들에서 Meld를 설치했습니다.
그런 다음 Meld를 기본 병합 도구로 지원하도록 .gitconfig를 구성했습니다.
[merge]
tool = meld
[mergetool "meld"]
path = C:\\Program Files (x86)\\Meld\\meld\\meld.exe
keepBackup = false
trustExitCode = false
따라서 충돌이 발생하면 git difftool을 수행하고 Meld는 실제로 열립니다. 그러나 Git이 diff 도구에 전달하기 위해 작성하는 파일의 경로가 올바르지 않습니다. 예를 들어 Git이 저장소 디렉토리 (내가 git mergetool을 호출 한 위치)에 BASE, LOCAL 및 REMOTE 파일을 생성하더라도 Meld는 실행 파일의 디렉토리에서 각 파일을 열려고합니다.
C : \ repo \ roses.txt.LOCAL.2760.txt를 여는 대신 Meld는 C : \ Program Files (x86) \ Meld \ meld \ roses.txt.LOCAL.2760.txt를 열려고합니다.
누구든지 전에이 문제를 겪었거나 Windows에서 올바르게 작동하도록 Git / Meld를 구성하는 방법을 알고 있습니까?
Windows 용 git bash를 사용하지 않는 이유는 무엇입니까?
meld를 간단히 설치 한 후 :
git config --global merge.tool meld
git config --global mergetool.meld.path "C:\Program Files (x86)\Meld\Meld.exe" <- path to meld here
그게 다야!
Schuess, 디렉토리의 공백 문자에주의하십시오!
[merge]
tool = meld
[mergetool "meld"]
prompt = false
keepBackup = false
keepTemporaries = false
path = C:/Program Files (x86)/Meld/meld.exe
cmd = '\"/c/Program Files (x86)/Meld/meld.exe\" $PWD/$LOCAL $PWD/$BASE $PWD/$REMOTE --output=$PWD/$MERGED'
나는 똑같은 문제가 있었고 그것이 작동하도록 내 방식대로 무차별 대입해야한다는 것을 알았습니다. 여기에 .gitconfig 파일에 넣은 내용이 있습니다. (내 meld 실행 파일은 다른 위치에 있습니다)
[merge]
tool = meld
[mergetool "meld"]
cmd = "/c/Meld/meld/meld.exe $PWD/$LOCAL $PWD/$BASE $PWD/$REMOTE --output=$PWD/$MERGED"
이 페이지의 meld 설치 프로그램의 버그 보고서에서 해결책을 찾았습니다.
https://code.google.com/p/meld-installer/issues/detail?id=11
내가 아는 한 문제는 meld.exe 프로그램 (python 인터프리터를 통해 meld를 실행)이 명령의 작업 디렉토리를 meld.exe의 작업 디렉토리로 불필요하게 설정한다는 것입니다. 이로 인해 명령 줄 인수로 전달 될 때 상대 경로가 잘못 해석됩니다.
해결책은 제공된 meld.exe를 AHK2EXe (AutoHotKey 스크립트-> exe)를 사용하여 meld.ahk 파일을 컴파일하여 생성 된 것으로 바꾸는 것입니다. 페이지 아래에 몇 가지 버전이 게시되어 있으므로 스크립트를 다운로드하십시오.
Windows :
Meld.exe에 대한 적절한 경로를 사용하여 다음 두 명령 ( Arugin이 말한대로 )을 사용할 수 있습니다 .
git config --global merge.tool meld
git config --global mergetool.meld.path "C:\Program Files (x86)\Meld\Meld.exe"
또는 C:\Users\YOUR_USER_NAME\.gitconfig파일을 직접 편집 하고 파일 끝에 다음을 추가 할 수 있습니다 .
[merge]
tool = meld
[mergetool "meld"]
path = C:\\Program Files (x86)\\Meld\\Meld.exe
이제 git difftoolWindows 용 Git Bash를 호출 하면 Meld가 기본 difftool 뷰어로 열립니다.
Linux:
UPDATE 20 Sept. 2019:
- I might as well put the Linux version here too for my own reference in one place if nothing else:
For Linux it's super easy too:
sudo apt update
sudo apt install meld
gedit ~/.gitconfig # edit your ~/.gitconfig file (gedit GUI editor will open)
Then add to the bottom of the .gitconfig file:
[diff]
tool = meld
That's it! git difftool now works on Linux Ubuntu!
I too faced similar issue.Operating system used is Windows 10 and the following changes worked for me.It seems more like path issue
git config --global mergetool.meld.path "/c/Program Files (x86)/Meld/Meld.exe" <- path to meld here
None of the answers worked for me. I ended up with this in the .gitconfig-file:
[merge]
tool = meld
[mergetool "meld"]
cmd = 'C:/Program Files (x86)/Meld/Meld.exe' $LOCAL $BASE $REMOTE --output=$MERGED
[mergetool]
prompt = false
After a git merge mybranch ending with conflicts, you simply type git mergetool and meld opens. After a save, you have to commit in git and the conflicts are resolved.
For some reason, this only worked with Meld 3.18.x, Meld 3.20.x gives me an error.
For some reason, in Windows 10 the PATH environmental variable could not be set properly during the installation, so a strange exception is raised saying that it is not able to find some .dll that are under "C:\Program Files (x86)/Meld/bin" directory.
A workaround for me was, execute in git bash:
export PATH=$PATH:"/C/Program Files (x86)/Meld/lib"
Or add to windows PATH
C:\Program Files (x86)/Meld/bin
After trying all of the above, setting Meld to run as administrator worked for me.
- Right-click Meld.exe
- Go to Properties > Compatibility and select the
Run this program as an administratorcheckbox
The errors I received referenced temp files like c:\windows\temp\meld-*, which were not being created. Elevating Meld's permissions seems to do the trick as it now works with both git difftool and running manually within Meld.
참고URL : https://stackoverflow.com/questions/14821358/git-mergetool-with-meld-on-windows
'Programing' 카테고리의 다른 글
| Git 하위 모듈. (0) | 2020.09.24 |
|---|---|
| # 1071-지정된 키가 너무 깁니다. (0) | 2020.09.24 |
| 내 Ruby 프로그램이 실행중인 운영 체제를 어떻게 찾을 수 있습니까? (0) | 2020.09.24 |
| 'uint32_t'식별자를 찾을 수 없음 오류 (0) | 2020.09.24 |
| @synchronized ()는 목적 C에서 싱글 톤 메소드로 무엇을합니까? (0) | 2020.09.24 |