Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The following commands

$ git co -b newbranch
$ git co oldbranch

result in "fatal: cannot exec 'git-co': Permission denied" error.

In the same time,

$ git checkout -b newbranch
$ git checkout oldbranch


$ sudo git co -b newbranch
$ sudo git co oldbranch

work as expected. Ownership rights for the .git folder are set for the user owning the home folder and 0755/0644 are the mode for .git folder/subfolder/files.

Aliases are defined in .gitconfig of the home folder:

co = checkout

There is no difference in git config -l output for root or unprivileged user.

What am I missing?

Gentoo 3.0.6 / git

share|improve this question
up vote 1 down vote accepted

The issue is resolved, see

Before git runs the aliases it checks the $PATH. In case the directory does not exist, or lacks permissions, git produces the "fatal: cannot exec 'git-co': Permission denied".

Good people from the git mailing list also reminded me of a tool, that strace can help finding the entry that is returning EACCES, as in: strace -f -e execve git foobar

The credit goes to Jeff King from the git mailing list. :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.