git merge error "fatal: stash failed" on macos with git-crypt

266 Views Asked by At

On macos, using git and git-crypt, no idea whats going wrong and how to debug it:

From a feature branch:

GIT_TRACE=2 GIT_TRACE_PACK_ACCESS=true GIT_TRACE_SETUP=true GIT_ASKPASS=true git merge master

11:00:47.179302 trace.c:310             setup: git_dir: .git
11:00:47.179619 trace.c:311             setup: git_common_dir: .git
11:00:47.179623 trace.c:312             setup: worktree: /Users/tdecaux/devops-docker
11:00:47.179626 trace.c:313             setup: cwd: /Users/tdecaux/devops-docker
11:00:47.179629 trace.c:314             setup: prefix: (null)
11:00:47.179681 chdir-notify.c:67       setup: chdir from '/Users/tdecaux/devops-docker' to '/Users/tdecaux/devops-docker'
11:00:47.179687 git.c:439               trace: built-in: git merge master
11:00:47.180899 packfile.c:1641         .git/objects/pack/pack-ecc09223a926974948b38ab4cf9d2c1458227b58.pack 12352217


11:00:47.195181 run-command.c:655       trace: run_command: '"git-crypt" clean'
11:00:47.209903 git.c:439               trace: built-in: git rev-parse --git-dir
11:00:47.213576 run-command.c:655       trace: run_command: git stash create
11:00:47.217756 trace.c:310             setup: git_dir: .git
11:00:47.218130 trace.c:311             setup: git_common_dir: .git
11:00:47.218136 trace.c:312             setup: worktree: /Users/tdecaux/devops-docker
11:00:47.218138 trace.c:313             setup: cwd: /Users/tdecaux/devops-docker
11:00:47.218139 trace.c:314             setup: prefix: (null)
11:00:47.218186 chdir-notify.c:67       setup: chdir from '/Users/tdecaux/devops-docker' to '/Users/tdecaux/devops-docker'
11:00:47.218198 git.c:439               trace: built-in: git stash create
11:00:47.225162 run-command.c:655       trace: run_command: '"git-crypt" clean'
11:00:47.237452 git.c:439               trace: built-in: git rev-parse --git-dir

fatal: stash failed

I can run git stash fine.

1

There are 1 best solutions below

0
On

For me, this solves the issue:

git-crypt lock

git merge master

git-crypt unlock