Git does not wait for the external editors to close

I am facing this problem since over a month and could not find a similar issue reported on Internet.

I have various editors configured in Git config. I use Notepad++ as editor (for editing commit messages and interactive rebase), WinMerge as the difftool and Visual Studio as mergetool. Earlier, when issuing commands such as git commit or git difftool, Git would wait for these editors to close. Now, the same commands have stopped waiting. Since the commands exited prematurely, the commit message edited in Notepad++ gets ignored, and the temporary files created for the difftool are deleted before it can diff the revisions.

I have reinstalled and upgraded Git and rebooted computer a couple of times so far. It is possible that the issue is caused when cleaning up a few files/folders on PC but I cannot say for sure as the Git installation was untouched. Can you suggest on where the issue might be? Also, if someone can share a method to debug this issue, that would be great.

For now, I have removed the configuration for editors so Git can open the default Vim editor in the console. Also, I am currently using Git explorer inside Visual Studio and Visual Studio Code for diff-operations, but I would like to switch back to the command line.

In case, it helps, sharing the relevant Git configuration below:

[core]
    editor = notepad++.exe -multiInst -nosession -notabbar -noPlugin
    longPaths = true
[diff]
    tool = winmerge
[difftool]
    prompt = true
[difftool "winmerge"]
    cmd = WinMergeU.exe -e -u "$LOCAL" "$REMOTE"
    keepBackup = false

EDIT: Just opened my old laptop and issued git commit command. That too did not wait for Notepad++ to close, so this might be caused by a recent Windows update. Here’s the logging when GIT_TRACE environment variable set to 1.

> git commit
09:38:38.106555 exec-cmd.c:266          trace: resolved executable dir: C:/Users/username/scoop/apps/git/2.47.0/mingw64/bin
09:38:38.163388 git.c:479               trace: built-in: git commit
hint: Waiting for your editor to close the file...
09:38:38.229461 run-command.c:667       trace: run_command: GIT_INDEX_FILE=.git/index 'notepad++.exe -multiInst -nosession -notabbar -noPlugin' C:/myrepo/.git/COMMIT_EDITMSG
09:38:38.231049 run-command.c:928       trace: start_command: C:/Users/username/scoop/apps/git/2.47.0/usr/bin/sh.exe -c 'notepad++.exe -multiInst -nosession -notabbar -noPlugin "$@"' 'notepad++.exe -multiInst -nosession -notabbar -noPlugin' C:/myrepo/.git/COMMIT_EDITMSG
Aborting commit due to empty commit message.

I have switched to Visual Studio Code which lets the Git wait for the tabs to close. It is not clear why Git used to work properly with Notepad++ and WinMerge earlier. Below are the new Git configurations:

[core]
    editor = "C:\Users\jasanghv\scoop\apps\vscode\current\bin\code" --disable-extensions --wait
    longPaths = true
[diff]
    tool = vscode
[difftool "vscode"]
    cmd = "C:\Users\jasanghv\scoop\apps\vscode\current\bin\code" --diff "$LOCAL" "$REMOTE" --wait
    keepBackup = false
[merge]
    tool = vscode
[mergetool]
    prompt = false
    keepTemporaries = false
[mergetool "vscode"]
    cmd = "C:\Users\jasanghv\scoop\apps\vscode\current\bin\code" --merge "$REMOTE" "$LOCAL" "$BASE" "$MERGED" --wait
    keepBackup = false
    trustExitCode = true

2

The issue could be due to how git interacts with external editors, especially when they are not blocking the process. Check if the editor configurations have background execution flags that prevent Git from waiting. For Notepad++, try adding -wait to the command in the Git config: editor = notepad++.exe -multiInst -nosession -notabbar -noPlugin -wait.

Additionally, ensure that WinMerge and Visual Studio are configured to block Git until the process is complete.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật