Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git error: fatal: cannot run /usr/bin/true: No such file or directory #362

Open
kilianyp opened this issue Oct 30, 2023 · 3 comments
Open

Comments

@kilianyp
Copy link

When running git amend I am faced with the following error:

Commit to amend (1-2): 2
> git commit --fixup efa9629033b21c58fadb220f5add01e7a1124a30
> git rebase -i --autosquash --autostash origin/master
git error: fatal: cannot run /usr/bin/true: No such file or directory
error: unable to start editor '/usr/bin/true'
panic: exit status 1

goroutine 1 [running]:
github.com/ejoffe/spr/git/realgit.(*gitcmd).MustGit(0x7c6e34?, {0xc000034a80?, 0xc0000d3d00?}, 0x2?)
        /Users/runner/work/spr/spr/git/realgit/realcmd.go:44 +0x3c
github.com/ejoffe/spr/spr.(*stackediff).AmendCommit(0xc00007afc0, {0xa9ea40?, 0xc0000106c0?})
        /Users/runner/work/spr/spr/spr/spr.go:85 +0x586
main.main()
        /Users/runner/work/spr/spr/cmd/amend/main.go:66 +0x3af

I am on ubuntu:

git version 2.39.2
Release:        18.04
@kilianyp
Copy link
Author

git rebase -i --autosquash --autostash origin/master

That command still works fine in isolation, e.g. if I run git commit --fixup.. and then git rebase... manually.

@kilianyp
Copy link
Author

I solved it by manually creating a /bin/usr/true that just echos 1.

I am using zsh, where which true returns true: shell built-in command.

@arbll
Copy link
Contributor

arbll commented Mar 2, 2024

Ran into the same issue, I'm also a zsh user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants