Does Git have a race condition with itself?
Git is at 2.47.1 and this happened as part of a routinegit -C /usr/src pull -j `nproc` --no-edit --no-ff -p
andgit -C /usr/src rebase stable/14 stable/14+local
:
Already up to date. error: cannot lock ref 'HEAD': Unable to create '/usr/src/.git/HEAD.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue. error: could not switch to stable/14+local
Maybe a should add a sleep
command between git pull
and git rebase
. Would five seconds be sufficient?